Skip to content

Instantly share code, notes, and snippets.

@nomothetis
Created July 23, 2014 03:44
Show Gist options
  • Save nomothetis/c361a5549a60f3fbc739 to your computer and use it in GitHub Desktop.
Save nomothetis/c361a5549a60f3fbc739 to your computer and use it in GitHub Desktop.
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