-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Synchronise access to shared ARTLocalDevice variable
We currently read / write the variable that stores the shared ARTLocalDevice variable from the internal queue of the ARTRest instance through which the device is being accessed. But, since each ARTRest instance has its own queue, this means that access to this variable isn’t currently synchronised between multiple ARTRest instances. So, here we do that. This also allows us to remove our usage of dispatch_once. This is a good thing, because we were using it incorrectly before. From an Apple engineer on https://stackoverflow.com/a/19845164: > The implementation of dispatch_once() requires that the > dispatch_once_t is zero, and has never been non-zero. That is, you can’t reset a dispatch_once_t variable and expect dispatch_once to still work with it, which is what we were doing.
- Loading branch information
1 parent
2e7b8b0
commit fbd5645
Showing
2 changed files
with
29 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters