how to set a threadname in MacOSX how to set a threadname in MacOSX multithreading multithreading

how to set a threadname in MacOSX


I recommend the following:

[[NSThread currentThread] setName:@"My thread name"]; // For Cocoa  pthread_setname_np("My thread name"); // For GDB.

(You'll need to include pthread.h)Works a treat in XCode 3.2.3 (at least for iPhone development)


Which version of Xcode are you using? Thread names are only supported in Mac OS X 10.6 and Xcode 3.2.