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
F3541918: D4381.id14476.diff
Thu, Dec 26, 7:28 AM
F3541916: D4381.id.diff
Thu, Dec 26, 7:28 AM
Unknown Object (File)
Sun, Dec 15, 4:59 PM
Unknown Object (File)
Sun, Dec 15, 4:59 PM
Unknown Object (File)
Sun, Dec 15, 4:59 PM
Unknown Object (File)
Sun, Dec 15, 4:59 PM
Unknown Object (File)
Sun, Dec 15, 4:59 PM
Unknown Object (File)
Sun, Dec 15, 4:59 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