On Aug 9, 2013, at 12:37 , Greg Parker <gpar...@apple.com> wrote:

> The assumption is that if you're destroying the semaphore and the count 
> doesn't match then there is some worker still in progress that is going to 
> signal the dead semaphore later. Detecting this error at semaphore 
> destruction time instead of crashing at dead-semaphore signal time is a 
> safety feature.

I believe I mentioned, the last time this came up, that I know of at least one 
case where matching isn't possible: AudioQueues. If the resource being counted 
is AudioQueueBuffers, stopping the queue discards any buffers that have been 
passed to the framework, without the callback being called to indicate this 
(and it's documented to behave this way).

> you can use whatever crazy unbalanced algorithms you like

Hey, buddy, that one ain't *my* crazy algorithm! ;)

However, the alternative approach is a fine, er, alternative.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to