Re: How to tell which thread is which in the debugger?
Re: How to tell which thread is which in the debugger?
- Subject: Re: How to tell which thread is which in the debugger?
- From: Greg Parker <email@hidden>
- Date: Thu, 22 Mar 2012 11:09:07 -0700
On Mar 22, 2012, at 11:02 AM, Wade Tregaskis <email@hidden> wrote:
> Jens Alfke wrote:
>> I was hoping that the ‘name’ property of the NSThread would show up in the debugger, since it does display names with some threads. But it doesn’t. (Why not?) How can I set a name that will show up in the debugger — do I need to use the pthreads API for that?
>
> You should try pthread_setname_np(). When that was first added (Snow Leopard?) it was orthogonal to NSThread's naming scheme (which was basically solely for use in the debugger via `po`). I thought the two had been reconciled - I filed the bug suggesting as such, back in the day - but perhaps it didn't happen.
As of Lion, [[NSThread currentThread] setName:@"name"] uses pthread_setname_np(). Calling -[NSThread setName:] on a thread that is not the current thread does not.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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