Last active
November 23, 2018 15:57
-
-
Save ANSCoder/d87eaf036145dafa5489d78ff415819a to your computer and use it in GitHub Desktop.
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
func syncWork(){ | |
let northZone = DispatchQueue(label: "perform_task_with_team_north") | |
let southZone = DispatchQueue(label: "perform_task_with_team_south") | |
northZone.sync { | |
for numer in 1...3{ print("North \(numer)")} | |
} | |
southZone.sync { | |
for numer in 1...3{ print("South \(numer)") } | |
} | |
} | |
//Call Func here | |
syncWork() | |
//Output | |
// North 1 | |
// North 2 | |
// North 3 | |
// South 1 | |
// South 2 | |
// South 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment