Created
April 20, 2017 14:26
-
-
Save YogevSitton-zz/152761065e9a44e0aa36ea3cabcf93f5 to your computer and use it in GitHub Desktop.
Beware of deadlocks with serial queues
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
let customSerialQueue = DispatchQueue(label: "com.yogevsitton.MyApp.myCustomSerialQueue") | |
customSerialQueue.sync { | |
// Synchronous code | |
customSerialQueue.sync { | |
// This code will never be executed and the app is now in deadlock | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment