Base——ThreadLocal类

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zxt_1/article/details/89893312
1.线程特定数据(Thread-specificData,TSD)在Thread类.中通过__thread来标示属于线程自己内部数据,但只能适用于POD类型数据,对于其它类型的变量利用POSIX线程库所提供的方法。intpthread_key_create(pthread_key_t*key,void(*destructor)(void*));线程退出时,调用destr...
1.线程特定数据(Thread-specific Data,TSD) 在Thread类.中通过 __thread 来标示属于线程自己内部数据,但只能适用于POD类型数据,对于其它类型的变量利用POSIX线程库所提供的方法。 int pthread_key_create(pthread_key_t *key, void (*destructor)(void*)); 线程退出时,调用 destr

猜你喜欢

转载自blog.csdn.net/zxt_1/article/details/89893312