Re: dispatch_semaphore crash on deletion
Re: dispatch_semaphore crash on deletion
- Subject: Re: dispatch_semaphore crash on deletion
- From: Quincey Morris <email@hidden>
- Date: Mon, 28 Apr 2014 13:25:01 -0700
On Apr 28, 2014, at 13:02 , Ken Thomases <email@hidden> wrote:
> I've seen this discussed before, but I don't remember where. One of the Apple engineers acknowledged the issue. This check is not done (or not effective) if the semaphore is created with a value of 0.
It was here, a few months ago. I was complaining about this — there are situations involving Cocoa frameworks where you don’t get the opportunity to restore the value back to its original setting. Greg Parker stated that it’s a feature, not a bug.
> So, the workaround is to create it with a value of 0 and then call dispatch_semaphore_signal() to increase the value up to the size of your resource pool.
Indeed. It’s a minor irritation to have to remember to do so.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden