Is it possible to implement Counting Semaphore in ios application?
In Swift 3 you can use a DispatchSemaphore
.
// initialization
let semaphore = DispatchSemaphore(value: initialValue)
// wait, decrement the semaphore count (if possible) or wait until count>0
semaphore.wait()
// release, increment the semaphore count
semaphore.signal()