Page MenuHomePhabricator

Implement interface for inter process non-blocking binary lock based on POSIX semaphores
ClosedPublic

Authored by marcin on Jun 28 2022, 8:32 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 4:54 AM
Unknown Object (File)
Mon, Nov 25, 2:55 AM
Unknown Object (File)
Mon, Nov 25, 2:52 AM
Unknown Object (File)
Mon, Nov 25, 2:29 AM
Unknown Object (File)
Mon, Nov 25, 2:19 AM
Unknown Object (File)
Mon, Nov 25, 2:18 AM
Unknown Object (File)
Mon, Nov 25, 12:49 AM
Unknown Object (File)
Mon, Nov 11, 7:48 PM

Details

Summary

Implement methods from parent diff

Test Plan

Temporarily modify NotificationService and AppDelegate so that the first writes notification to a file from which the second reads upon app launch. Cover reads and writes with semaphore operations. Use debugger to hold semaphore in AppDelegate, trigger notification and see that NotificationService did not acquire semaphore (simply logs it).

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

This revision is now accepted and ready to land.Jun 29 2022, 6:11 AM

Introduce files to project.pbxproj

Add proper error handling to destroyLock method.

native/ios/Comm/TemporalMessageStorage/NonBlockingLock.mm
15–42 ↗(On Diff #14160)

Spacing here looks broken. Is this really how XCode is formatting it? Can we try to improve this?

native/ios/Comm/TemporalMessageStorage/NonBlockingLock.mm
15–42 ↗(On Diff #14160)

I don't use XCode for formatting - I rely on yarn clang-format-all command.

Spacing here looks broken.

What exactly do you refer to? I think you may refer to NSLocalizedDescriptionKey : [NSString. Actually spacing is correct here. Additional space is introduced between NSLocalizedDescriptionKey and : since it is not a method call but initialization of Objective - C dictionary. We do no introduce before after : if it precedes argument in method call, but we do so if it precedes value under a given key in Objective-C dictionary initialization. Example: https://stackoverflow.com/questions/9195573/initializing-nsdictionary.

native/ios/Comm/TemporalMessageStorage/NonBlockingLock.mm
15–42 ↗(On Diff #14160)

Ah okay, that's fair... sorry for my confusion

Rename Temporal to Temporary