The way I would do it, even though it may be old fashioned, would be to define 
an int (or NSNumber) in each of the operations that could be involved in the 
hang (race condition) that is assigned a value other than 0 that  uniquely 
represents the operation when it begins and set back to 0 when it ends. Then, 
in the code that is guaranteed to be executed when the hang occurs, check the 
values of the flag values to see which are executing at that point. Indication 
of 2 or more being in execution simultaneously identifies the culprits.
On Jul 29, 2012, at 4:56 PM, John MacMullin wrote:

> My app hangs due to what appears to be two competing operations.  Appears 
> because other possible reasons may exist.
> 
> How do I snapshot, debug or otherwise detect and obtain a stack trace of the 
> code causing the hang?
> 
> Best regards,
> 
> John MacMullin
> _______________________________________________
> 
> 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/3tothe4th%40comcast.net
> 
> This email sent to 3tothe...@comcast.net

Charlie Dickman
3tothe...@comcast.net




_______________________________________________

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