獲取線程Id的方法

第一種: gettid(), man gettid 能夠看到gettid的使用方式。  使用時要先定義:_syscall0(pid_t, gettid) php 其中_syscall0是一個宏(因爲參數的不一樣還有_syscall1,_syscall2...),定義以下: linux   #define _syscall0(type,name) \ type name(void) \ { \
相關文章
相關標籤/搜索