Quantcast
Channel: EmotiCODE - Snippets and Source Code Search Engine
Viewing all articles
Browse latest Browse all 7

GCD: Serial queue for throttling

$
0
0
What is this doing? Create a semaphore for one (1) resource. Create a serial queue. If green light, run the block asynchronously, and set green light. If red, do nothing. Note that DISPATCHTIMENOW means "timeout=none", so it returns non zero immediately if light is not green.

Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles



Latest Images