Skip to content

Instantly share code, notes, and snippets.

@vialyx
Created November 15, 2018 19:11
Show Gist options
  • Save vialyx/64681990101513703af8ec26997e28ce to your computer and use it in GitHub Desktop.
Save vialyx/64681990101513703af8ec26997e28ce to your computer and use it in GitHub Desktop.
let concurent = DispatchQueue.init(label: "defaultQos", attributes: .concurrent)
concurent.sync {
print("sync defaultQos exec")
// 1
}
concurent.sync {
print("sync defaultQos exec")
// 2
}
DispatchQueue.init(label: "defaultQos").async {
print("async defaultQos exec")
// 4
}
print("sync main exec")
// 3
/* console output
sync defaultQos exec
sync defaultQos exec
sync main exec
async defaultQos exec
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment