diff --git a/native/ios/Comm.xcodeproj/project.pbxproj b/native/ios/Comm.xcodeproj/project.pbxproj --- a/native/ios/Comm.xcodeproj/project.pbxproj +++ b/native/ios/Comm.xcodeproj/project.pbxproj @@ -208,6 +208,7 @@ CB3C621327CE66540054F24C /* libEXSecureStore.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libEXSecureStore.a; sourceTree = BUILT_PRODUCTS_DIR; }; CB64AA74284F4DC900460699 /* ThreadOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadOperations.cpp; path = ../PersistentStorageUtilities/ThreadOperationsUtilities/ThreadOperations.cpp; sourceTree = ""; }; CB64AA75284F4DC900460699 /* ThreadOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadOperations.h; path = ../PersistentStorageUtilities/ThreadOperationsUtilities/ThreadOperations.h; sourceTree = ""; }; + CBEA4A88286EEC9100DFCFF5 /* NonBlockingLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NonBlockingLock.h; path = Comm/TemporalMessageStorage/NonBlockingLock.h; sourceTree = ""; }; F53DA7B3F26C2798DCE74A94 /* Pods-Comm.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Comm.debug.xcconfig"; path = "Target Support Files/Pods-Comm/Pods-Comm.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -318,6 +319,7 @@ 71B8CCB626BD30EC0040C0A2 /* CommCoreImplementations */ = { isa = PBXGroup; children = ( + CBEA4A87286EEC7600DFCFF5 /* TemporalMessageStorage */, 71762A74270D8AAE00F565ED /* PlatformSpecificTools.mm */, 71D4D7CB26C50B1000FCDBCD /* CommSecureStore.mm */, 71142A7526C2650A0039DCBD /* CommSecureStoreIOSWrapper.h */, @@ -555,6 +557,14 @@ path = ThreadOperationsUtilities; sourceTree = ""; }; + CBEA4A87286EEC7600DFCFF5 /* TemporalMessageStorage */ = { + isa = PBXGroup; + children = ( + CBEA4A88286EEC9100DFCFF5 /* NonBlockingLock.h */, + ); + name = TemporalMessageStorage; + sourceTree = ""; + }; CBED0E2C284E086100CD3863 /* PersistentStorageUtilities */ = { isa = PBXGroup; children = ( diff --git a/native/ios/Comm/TemporalMessageStorage/NonBlockingLock.h b/native/ios/Comm/TemporalMessageStorage/NonBlockingLock.h new file mode 100644 --- /dev/null +++ b/native/ios/Comm/TemporalMessageStorage/NonBlockingLock.h @@ -0,0 +1,14 @@ +#import +#import + +#import + +@interface NonBlockingLock : NSObject +@property(readonly) const char *lockName; +@property(readonly, atomic) sem_t *lockHandle; + +- (instancetype)initWithName:(NSString *)lockName; +- (BOOL)tryAcquireLock:(NSError **)err; +- (void)releaseLock:(NSError **)err; +- (void)destroyLock:(NSError **)err; +@end