IOSAD-157 Can shut down with injectSyncEvent:nil IOSAD-157
authorDirk Zimmermann <dz@pep.security>
Mon, 18 Nov 2019 15:54:57 +0100
branchIOSAD-157
changeset 13380735d0ea84eb
parent 1337 fe92ccdcec25
child 1339 a59832da74a0
IOSAD-157 Can shut down with injectSyncEvent:nil
pEpObjCAdapter/PEPSync.m
     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 @@ -175,10 +175,7 @@
     1.4  {
     1.5      if (self.syncThread) {
     1.6          [self injectSyncEvent:nil];
     1.7 -        [self.conditionLockForJoiningSyncThread lockWhenCondition:YES];
     1.8 -        [self.conditionLockForJoiningSyncThread unlock];
     1.9      }
    1.10 -    self.conditionLockForJoiningSyncThread = nil;
    1.11  }
    1.12  
    1.13  // MARK: - Private
    1.14 @@ -249,7 +246,11 @@
    1.15          [self.queue enqueue:value];
    1.16      } else {
    1.17          [self.queue prequeue:value];
    1.18 +        [self.conditionLockForJoiningSyncThread lockWhenCondition:YES];
    1.19 +        [self.conditionLockForJoiningSyncThread unlock];
    1.20 +        self.conditionLockForJoiningSyncThread = nil;
    1.21      }
    1.22 +
    1.23      return 0;
    1.24  }
    1.25