-
-
Save rnapier/6d3b3a3a33f3d4bab19b to your computer and use it in GitHub Desktop.
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
func dispatch_sync<R> (queue: dispatch_queue_t, block: Void -> R ) -> R { | |
var result: R! | |
dispatch_sync(queue) { | |
result = block() | |
} | |
return result | |
} | |
func result() -> String { | |
return | |
dispatch_sync(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { | |
return "something" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment