¡@

Home 

2014/10/15 ¤U¤È 10:12:56

iphone Programming Glossary: producerconsumerlock

NSURLConnection blocking wrapper implemented with semaphores [closed]

http://stackoverflow.com/questions/13733124/nsurlconnection-blocking-wrapper-implemented-with-semaphores

and the background threads in an alternating way. The dispatch_semaphores code is nicely wrapped inside a custom ProducerConsumerLock class. BlockingConnection.m #import BlockingConnection.h #import ProducerConsumerLock.h @interface BlockingConnection @property.. nicely wrapped inside a custom ProducerConsumerLock class. BlockingConnection.m #import BlockingConnection.h #import ProducerConsumerLock.h @interface BlockingConnection @property nonatomic strong ProducerConsumerLock lock @end @implementation BlockingConnection.. #import BlockingConnection.h #import ProducerConsumerLock.h @interface BlockingConnection @property nonatomic strong ProducerConsumerLock lock @end @implementation BlockingConnection id initWithURL NSURL url callback void ^ NSData data callback if self super..