Alb*_*ert 18 c++ xcode multithreading gdb
在Windows中,可以通过此代码设置线程名称.然后,线程名将显示在调试器中.
在MacOSX中,我看到了几个提示,表明有线程名称.我认为NSThread类也有一个名称属性.我的目标是我可以在我的C++应用程序中设置threadname并在Xcode/gdb中查看它.
其他相关问题:
小智 30
我推荐以下内容:
[[NSThread currentThread] setName:@"My thread name"]; // For Cocoa
pthread_setname_np("My thread name"); // For GDB.
Run Code Online (Sandbox Code Playgroud)
(你需要包含pthread.h)在XCode 3.2.3中工作(至少对于iPhone开发)