Created
September 5, 2011 01:28
-
-
Save cqa02303/1193858 to your computer and use it in GitHub Desktop.
dispatch_syncに絶望してこんな事をしている
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
__block dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); | |
dispatch_async(queue, ^{ | |
// hogehoge | |
// ここに処理を書く | |
// | |
dispatch_semaphore_signal(semaphore); | |
}); | |
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); | |
dispatch_release(semaphore); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment