How is the debugger "thread title" derived from NSThread?

If the AppCode debugger's frames window, we can see various threads. Some have titles like "Thread-842637".

How does this title relate to the NSThread object?
Can I reproduce this title from an NSThread?

I have a list of NSThread objects, and I'd like to easily relate them back to the debugger.

Thanks for any assistance,
Troy



Attachment(s):
snap.png
1 comment
Comment actions Permalink

No, it's not related to the thread object. It's related to OSX threads. Though you can get this id via posix or low level system api:

 
#include <sys/syscall.h>
syscall(SYS_thread_selfid)


or

#include <pthread.h>

uint64_t tid;
pthread_threadid_np(NULL, &tid);
0

Please sign in to leave a comment.