On Mon, Aug 11, 2008 at 8:09 AM, Trygve Inda <[EMAIL PROTECTED]> wrote:
> I am seeing a deadlock I think... It works in the debugger, but hangs when
> running alone. The killThread is called as part of the
> applicationWillTerminate delegate method.

You can use gdb to attach to the program after it freezes to find out
where it's stuck. Or just use Shark, or sample in Activity Monitor.

>        if ([lock lockWhenCondition:kConditionThreadMustExit)

How does this even compile? The braces are unbalanced, and
lockWhenCondition: returns void.

In any case, you definitely have deadlock potential here. Your
-killThread method blocks waiting for the thread to exit. Your thread
blocks waiting for the main thread to complete. If both of these
happen at the same time, both of them are waiting for the other to
finish first.

Mike
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to