SO 上的帖子表明这pthread_t是一种不透明类型,不是数字,当然不是线程索引,您不应该直接比较pthread_t's 等。
问题:
为什么?是否真的打算支持没有线程数字 ID 的系统?当pthread_t实现很简单
typedef unsigned long int pthread_t;
Run Code Online (Sandbox Code Playgroud)
?
如何?上面一行之前有一个注释,所以它实际上是
/* Thread identifiers. The structure of the attribute type is not
exposed on purpose. */
typedef unsigned long int pthread_t;
Run Code Online (Sandbox Code Playgroud)
在pthreadtypes.h这是什么意思?什么属性类型?这不是某个全局线程表的索引吗?