NSLog中的thread number

来源:互联网 发布:lol免费刷金币软件 编辑:程序博客网 时间:2024/05/18 00:45

NSLog中的线程id,自己实现log的时候用得到

__uint64_t threadId=0;

 if (pthread_threadid_np(0, &threadId)) {

        threadId = pthread_mach_thread_np(pthread_self());

 }

 NSLog(@"%ld:%llu",(long)getpid(),threadId);

1 0
原创粉丝点击