Created
July 19, 2016 05:55
-
-
Save marmelroy/6b5ab63dad4056f3d156edcaedc60a0d 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 queue = DispatchQueue.global(attributes: .qosUserInitiated) | |
let mainQueue = DispatchQueue.main | |
mainQueue.async { | |
dispatchPrecondition(condition: .notOnQueue(mainQueue)) | |
// This code won't execute | |
} | |
queue.async { | |
dispatchPrecondition(condition: .onQueue(queue)) | |
// This code will execute | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment