Skip to content

Instantly share code, notes, and snippets.

@ANSCoder
Last active November 23, 2018 15:57
Show Gist options
  • Save ANSCoder/d87eaf036145dafa5489d78ff415819a to your computer and use it in GitHub Desktop.
Save ANSCoder/d87eaf036145dafa5489d78ff415819a to your computer and use it in GitHub Desktop.
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