Created
July 23, 2014 03:44
-
-
Save nomothetis/c361a5549a60f3fbc739 to your computer and use it in GitHub Desktop.
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
let key = "A-Recursive-Key" | |
public class Test { | |
let updateQueue:dispatch_queue_t | |
init() { | |
self.updateQueue = dispatch_queue_create("myQueue", DISPATCH_QUEUE_CONCURRENT) | |
withUnsafePointer(&self.updateQueue) { unsafePointer in | |
dispatch_queue_set_specific(self.updateQueue, key, unsafePointer, nil) | |
} | |
} | |
private func dispatch_sync_recursive(block:() -> ()) -> () { | |
withUnsafePointer(&self.updateQueue) { unsafePointer in | |
dispatch_queue_set_specific(self.updateQueue, key, unsafePointer, nil) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment