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 @@ -188,6 +188,7 @@ C562A7004903539402D988CE /* Pods-Comm.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Comm.release.xcconfig"; path = "Target Support Files/Pods-Comm/Pods-Comm.release.xcconfig"; sourceTree = ""; }; CB1648B027CFD07E00394D9D /* CommRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = CommRelease.entitlements; path = Comm/CommRelease.entitlements; sourceTree = ""; }; CB30C12327D0ACF700FBE8DE /* NotificationService.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NotificationService.entitlements; sourceTree = ""; }; + CB38B4792877179A00171182 /* NonBlockingLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NonBlockingLock.h; path = Comm/TemporaryMessageStorage/NonBlockingLock.h; sourceTree = ""; }; CB38F2AE286C6C870010535C /* MessageSpecs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MessageSpecs.h; path = PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs.h; sourceTree = ""; }; CB38F2AF286C6C870010535C /* MessageOperationsUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MessageOperationsUtilities.cpp; path = PersistentStorageUtilities/MessageOperationsUtilities/MessageOperationsUtilities.cpp; sourceTree = ""; }; CB38F2B0286C6C870010535C /* MessageOperationsUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MessageOperationsUtilities.h; path = PersistentStorageUtilities/MessageOperationsUtilities/MessageOperationsUtilities.h; sourceTree = ""; }; @@ -318,6 +319,7 @@ 71B8CCB626BD30EC0040C0A2 /* CommCoreImplementations */ = { isa = PBXGroup; children = ( + CB38B4782877177B00171182 /* TemporaryMessageStorage */, 71762A74270D8AAE00F565ED /* PlatformSpecificTools.mm */, 71D4D7CB26C50B1000FCDBCD /* CommSecureStore.mm */, 71142A7526C2650A0039DCBD /* CommSecureStoreIOSWrapper.h */, @@ -514,6 +516,14 @@ name = ExpoModulesProviders; sourceTree = ""; }; + CB38B4782877177B00171182 /* TemporaryMessageStorage */ = { + isa = PBXGroup; + children = ( + CB38B4792877179A00171182 /* NonBlockingLock.h */, + ); + name = TemporaryMessageStorage; + sourceTree = ""; + }; CB38F2AC286C6C010010535C /* MessageOperationsUtilities */ = { isa = PBXGroup; children = ( diff --git a/native/ios/Comm/TemporaryMessageStorage/NonBlockingLock.h b/native/ios/Comm/TemporaryMessageStorage/NonBlockingLock.h new file mode 100644 --- /dev/null +++ b/native/ios/Comm/TemporaryMessageStorage/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