IOSAD-157 Make PEPSync.isRunning a instance var IOSAD-157
authorDirk Zimmermann <dz@pep.security>
Mon, 18 Nov 2019 15:54:57 +0100
branchIOSAD-157
changeset 13454791470b2684
parent 1344 748e3ffd7804
child 1346 8f2421d56db4
IOSAD-157 Make PEPSync.isRunning a instance var
pEpObjCAdapter/PEPSync.m
pEpObjCAdapterFramework/PEPSync.h
     1.1 --- a/pEpObjCAdapter/PEPSync.m	Mon Nov 18 15:54:57 2019 +0100
     1.2 +++ b/pEpObjCAdapter/PEPSync.m	Mon Nov 18 15:54:57 2019 +0100
     1.3 @@ -157,6 +157,8 @@
     1.4  
     1.5  - (void)startup
     1.6  {
     1.7 +    self.isRunning = YES;
     1.8 +
     1.9      // Make sure queue is empty when we start.
    1.10      [self.queue removeAllObjects];
    1.11  
    1.12 @@ -178,11 +180,6 @@
    1.13      }
    1.14  }
    1.15  
    1.16 -- (BOOL)isRunning
    1.17 -{
    1.18 -    return self.conditionLockForJoiningSyncThread != nil;
    1.19 -}
    1.20 -
    1.21  // MARK: - Private
    1.22  
    1.23  + (void)initialize
    1.24 @@ -226,6 +223,8 @@
    1.25          os_log_error(s_logger, "could not create session for starting the sync loop");
    1.26      }
    1.27  
    1.28 +    self.isRunning = NO;
    1.29 +
    1.30      os_log(s_logger, "sync loop finished");
    1.31  
    1.32      session = nil;
     2.1 --- a/pEpObjCAdapterFramework/PEPSync.h	Mon Nov 18 15:54:57 2019 +0100
     2.2 +++ b/pEpObjCAdapterFramework/PEPSync.h	Mon Nov 18 15:54:57 2019 +0100
     2.3 @@ -18,6 +18,10 @@
     2.4   */
     2.5  @interface PEPSync : NSObject
     2.6  
     2.7 +/// Is the sync loop running?
     2.8 +@property (nonatomic) BOOL isRunning;
     2.9 +
    2.10 +
    2.11  @property (nonatomic, nullable, weak) id<PEPSendMessageDelegate> sendMessageDelegate;
    2.12  @property (nonatomic, nullable, weak) id<PEPNotifyHandshakeDelegate> notifyHandshakeDelegate;
    2.13  
    2.14 @@ -48,7 +52,4 @@
    2.15   */
    2.16  - (void)shutdown;
    2.17  
    2.18 -/// Is the sync loop running?
    2.19 -- (BOOL)isRunning;
    2.20 -
    2.21  @end