Created
October 2, 2019 06:24
-
-
Save AlexandrFadeev/ba4dd443eef6acfff88fb1b1401ffaa5 to your computer and use it in GitHub Desktop.
Semaphore example in Objective C
This file contains hidden or 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
dispatch_semaphore_t sema = dispatch_semaphore_create(0); | |
[object runSomeLongOperationAndDo:^{ | |
// hack hack hack... | |
dispatch_semaphore_signal(sema); | |
}]; | |
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER); | |
dispatch_release(sema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment