Last active
November 7, 2017 07:44
-
-
Save muizidn/f2ee5e6b5aaf54a7bf8b8fa42361b766 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
var gajah: Gajah? = nil | |
// Membuat custom queue | |
let barrierQueue = DispatchQueue(label: "concurrentBarrierQueue", attribute : .concurrent) | |
// Mengisi / Writing | |
barrierQueue.async(flags: .barrier) { | |
gajah = Gajah() | |
} | |
// Membaca / Reading | |
barrierQueue.sync { | |
print(gajah.belalai.panjang) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment