posix thread编程相关知识

一 类型定义

1 文件: bits/pthreadtypes.h

类型:typedef unsigned long int pthread_t;

类型:typedef unsigned int pthread_key_t;

 

二 函数声明

 

1 pthread_t pthread_t pthread_self(void)

返回调用该接口的线程的ID;

 

2 int pthread_key_create(pthread_key_t *key, void (*destructor)(void*))

创建一个key,该key与特定的数值绑定,一个进程的不同线程调用相同值的时候得到空间都是在它自身空间里的。

 

3 void *pthread_getspecific(pthread_key_t key)
  int pthread_setspecific(pthread_key_t key, const void *value)

将特定的值与特定的key(pthread_key_create产生)相关联,以及获取特定key相关的值。

 

4

 

posted @ 2011-01-22 23:55  茫茫深海一条鱼  阅读(184)  评论(0)    收藏  举报