IOS-975 avoid race condition in tests when ensuring the main session
authorDirk Zimmermann <dirk@pep-project.org>
Tue, 20 Mar 2018 13:03:07 +0100
changeset 549a338e3afd9c2
parent 548 09ec46b2113d
child 550 c6ac36a539f3
IOS-975 avoid race condition in tests when ensuring the main session
pEpObjCAdapter/PEPSessionProvider.m
     1.1 --- a/pEpObjCAdapter/PEPSessionProvider.m	Mon Mar 19 12:30:16 2018 +0100
     1.2 +++ b/pEpObjCAdapter/PEPSessionProvider.m	Tue Mar 20 13:03:07 2018 +0100
     1.3 @@ -94,6 +94,10 @@
     1.4   */
     1.5  + (void)assureSessionForMainThreadExists
     1.6  {
     1.7 +    if (s_sessionForMainThread) {
     1.8 +        return;
     1.9 +    }
    1.10 +
    1.11      void (^creationBlock)(void) = ^{
    1.12          if (s_sessionForMainThread) {
    1.13              return;