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
F3363430: D4381.id14160.diff
Mon, Nov 25, 2:19 AM
F3363429: D4381.id14062.diff
Mon, Nov 25, 2:18 AM
F3363204: D4381.diff
Mon, Nov 25, 12:49 AM
Unknown Object (File)
Mon, Nov 11, 7:48 PM
Unknown Object (File)
Mon, Nov 11, 7:42 PM
Unknown Object (File)
Mon, Nov 11, 6:35 PM
Unknown Object (File)
Mon, Nov 11, 6:17 PM
Unknown Object (File)
Mon, Nov 11, 4:04 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
Lint Not Applicable
Unit
Tests Not Applicable

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