Re: NSImage from bitmap - then delete bitmap
Re: NSImage from bitmap - then delete bitmap
- Subject: Re: NSImage from bitmap - then delete bitmap
- From: Quincey Morris <email@hidden>
- Date: Fri, 22 Jul 2016 20:02:25 -0700
- Feedback-id: 167118m:167118agrif8a:167118sKiax6pMTK:SMTPCORP
On Jul 22, 2016, at 19:29 , Graham Cox <email@hidden> wrote:
>
> If the worker thread is waiting for -performOnMainThread to complete, it *cannot* possibly get a call from the main thread to terminate
I nodded agreement when I first read this, then “but wait!” …
Your logic seems flawed on two counts:
1. The selector performed by the worker thread may still be queued, so the main thread is doing something else which may result in an attempt to terminate the worker thread.
2. The worker method performed on the main thread may directly or indirectly lead to an attempt to terminate the worker thread.
Both scenarios could cause a deadlock. At least, that’s my attempt at logic.
The real problem is that it’s simply a bug to have two threads with mutual, synchronous, unconditional waits. Of course that’s going to deadlock eventually.
_______________________________________________
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