Revision: 14172
          http://sourceforge.net/p/skim-app/code/14172
Author:   hofman
Date:     2024-04-03 16:06:52 +0000 (Wed, 03 Apr 2024)
Log Message:
-----------
no accessor for shouldKeepRunning

Modified Paths:
--------------
    trunk/SKPDFSynchronizer.h
    trunk/SKPDFSynchronizer.m

Modified: trunk/SKPDFSynchronizer.h
===================================================================
--- trunk/SKPDFSynchronizer.h   2024-04-03 15:56:17 UTC (rev 14171)
+++ trunk/SKPDFSynchronizer.h   2024-04-03 16:06:52 UTC (rev 14172)
@@ -72,7 +72,6 @@
 
 @property (nonatomic, nullable, weak) id <SKPDFSynchronizerDelegate> delegate;
 @property (nullable, copy) NSString *fileName;
-@property (readonly) BOOL shouldKeepRunning;
 
 - (void)findFileAndLineForLocation:(NSPoint)point inRect:(NSRect)rect 
pageBounds:(NSRect)bounds atPageIndex:(NSUInteger)pageIndex;
 - (void)findPageAndLocationForLine:(NSInteger)line inFile:(NSString *)file 
options:(SKPDFSynchronizerOption)options;

Modified: trunk/SKPDFSynchronizer.m
===================================================================
--- trunk/SKPDFSynchronizer.m   2024-04-03 15:56:17 UTC (rev 14171)
+++ trunk/SKPDFSynchronizer.m   2024-04-03 16:06:52 UTC (rev 14172)
@@ -90,7 +90,7 @@
 @implementation SKPDFSynchronizer
 
 @synthesize delegate;
-@dynamic fileName, shouldKeepRunning;
+@dynamic fileName;
 
 + (void)initialize {
     SKINITIALIZE;
@@ -128,10 +128,6 @@
 
 #pragma mark Thread safe accessors
 
-- (BOOL)shouldKeepRunning {
-    return atomic_load(&shouldKeepRunning);
-}
-
 - (NSString *)fileName {
     [lock lock];
     NSString *file = fileName;
@@ -258,7 +254,7 @@
                 
                 [sc scanCharactersFromSet:newlines intoString:NULL];
                 
-                while ([self shouldKeepRunning] && [sc scanCharacter:&ch]) {
+                while (atomic_load(&shouldKeepRunning) && [sc 
scanCharacter:&ch]) {
                     
                     switch (ch) {
                         case 'l':
@@ -321,7 +317,7 @@
                 [[pdfsync pages] 
makeObjectsPerformSelector:@selector(sortUsingDescriptors:)
                                        withObject:recordSortDescriptors];
                 
-                rv = [self shouldKeepRunning];
+                rv = atomic_load(&shouldKeepRunning);
             }
         }
     }
@@ -342,7 +338,7 @@
                 NSMapInsert([synctex filenames], (__bridge void *)[self 
sourceFileForFileName:[NSString stringWithUTF8String:fileRep] isTeX:YES 
removeQuotes:NO], (void *)fileRep);
             }
         } while ((node = synctex_node_next(node)));
-        rv = [self shouldKeepRunning];
+        rv = atomic_load(&shouldKeepRunning);
     }
     return rv;
 }
@@ -383,7 +379,7 @@
 
 - (void)findFileAndLineForLocation:(NSPoint)point inRect:(NSRect)rect 
pageBounds:(NSRect)bounds atPageIndex:(NSUInteger)pageIndex {
     dispatch_async(queue, ^{
-        if ([self shouldKeepRunning] && [self loadSyncFileIfNeeded]) {
+        if (atomic_load(&shouldKeepRunning) && [self loadSyncFileIfNeeded]) {
             NSInteger foundLine = 0;
             NSString *foundFile = nil;
             BOOL success = NO;
@@ -396,7 +392,7 @@
                     foundFile = [self sourceFileForFileName:foundFile 
isTeX:YES removeQuotes:NO];
             }
             
-            if (success && [self shouldKeepRunning]) {
+            if (success && atomic_load(&shouldKeepRunning)) {
                 dispatch_async(dispatch_get_main_queue(), ^{
                     [delegate synchronizerFoundLine:foundLine 
inFile:foundFile];
                 });
@@ -409,7 +405,7 @@
     if (file == nil)
         file = [self defaultSourceFile];
     dispatch_async(queue, ^{
-        if (file && [self shouldKeepRunning] && [self loadSyncFileIfNeeded]) {
+        if (file && atomic_load(&shouldKeepRunning) && [self 
loadSyncFileIfNeeded]) {
             NSUInteger foundPageIndex = NSNotFound;
             NSPoint foundPoint = NSZeroPoint;
             SKPDFSynchronizerOption foundOptions = options;
@@ -421,7 +417,7 @@
             else
                 success = [synctex findPage:&foundPageIndex 
location:&foundPoint forLine:line inFile:fixedFile];
             
-            if (success && [self shouldKeepRunning]) {
+            if (success && atomic_load(&shouldKeepRunning)) {
                 if (pdfsync)
                     foundOptions &= ~SKPDFSynchronizerFlippedMask;
                 else

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

Reply via email to