Revision: 16036
http://sourceforge.net/p/skim-app/code/16036
Author: hofman
Date: 2026-02-05 16:56:14 +0000 (Thu, 05 Feb 2026)
Log Message:
-----------
get syncFileName and lastModDate together inside lock
Modified Paths:
--------------
trunk/SKPDFSynchronizer.m
Modified: trunk/SKPDFSynchronizer.m
===================================================================
--- trunk/SKPDFSynchronizer.m 2026-02-05 16:43:34 UTC (rev 16035)
+++ trunk/SKPDFSynchronizer.m 2026-02-05 16:56:14 UTC (rev 16036)
@@ -43,14 +43,14 @@
static NSArray *SKPDFSynchronizerTexExtensions = nil;
@interface SKPDFSynchronizer ()
-@property (nullable, strong) NSString *syncFileName;
-@property (nullable, readonly) NSDate *lastModDate;
+@property (nonatomic, nullable, strong) NSString *syncFileName;
+@property (nonatomic, nullable, readonly) NSDate *lastModDate;
@end
@implementation SKPDFSynchronizer
-@synthesize delegate;
-@dynamic fileName, syncFileName, lastModDate;
+@synthesize delegate, syncFileName, lastModDate;
+@dynamic fileName;
+ (void)initialize {
SKINITIALIZE;
@@ -106,13 +106,6 @@
[lock unlock];
}
-- (NSString *)syncFileName {
- [lock lock];
- NSString *file = syncFileName;
- [lock unlock];
- return file;
-}
-
// this should only be used from the server thread
- (void)setSyncFileName:(NSString *)newSyncFileName {
// make sure the path is absolute and standardized
@@ -130,13 +123,6 @@
[lock unlock];
}
-- (NSDate *)lastModDate {
- [lock lock];
- NSDate *date = lastModDate;
- [lock unlock];
- return date;
-}
-
#pragma mark Support
- (NSString *)sourceFileForFileName:(NSString *)file {
@@ -195,10 +181,12 @@
BOOL rv = NO;
if (theFileName) {
+ [lock lock];
NSString *theSyncFileName = [self syncFileName];
+ NSDate *currentModDate = [self lastModDate];
+ [lock unlock];
if (theSyncFileName && [[NSFileManager defaultManager]
fileExistsAtPath:theSyncFileName]) {
- NSDate *currentModDate = [self lastModDate];
NSDate *modDate = nil;
[[NSURL fileURLWithPath:theSyncFileName isDirectory:NO]
getResourceValue:&modDate forKey:NSURLAttributeModificationDateKey error:NULL];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit