Skip to content

Instantly share code, notes, and snippets.

@tuchangwei
Created May 5, 2015 10:06
Show Gist options
  • Save tuchangwei/940c89b89af474f086fb to your computer and use it in GitHub Desktop.
Save tuchangwei/940c89b89af474f086fb to your computer and use it in GitHub Desktop.
GDC Demo
var group = dispatch_group_create()
var queue = dispatch_queue_create("me.tutuge.test.gcd", DISPATCH_QUEUE_CONCURRENT);
dispatch_group_async(group, queue, { () -> Void in
NSThread.sleepForTimeInterval(10)
println("First block done...")
})
dispatch_group_async(group, queue, { () -> Void in
NSThread.sleepForTimeInterval(5)
println("Second block done...")
})
dispatch_group_notify(group, queue) { () -> Void in
println("All Task Finish")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment