今天看到C语言的线程私有变量,讲的很有意思,发散下:C语言的线程私有变量(Thread special Data[TSD])类比于Java的Threadlocal.描述,很有意思。和原来写的,做个比较http://my.oschina.net/u/177808/blog/184348
[root@localhost pthread]# grep pthread_key pthreadtest.e
typedef unsigned int pthread_key_t;
extern int pthread_key_create (pthread_key_t *__key,
extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__));
extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__));
extern int pthread_setspecific (pthread_key_t __key,