标签:equal ack val 例子 oid ddr gets 多次 信号处理
线程标识
pthread_t pthread_self (void); int pthread_equal (pthread_t __thread1, pthread_t __thread2);
创建、退出、等待、取消线程
int pthread_create (pthread_t *__restrict __newthread, const pthread_attr_t *__restrict __attr, void *(*__start_routine) (void *), void *__restrict __arg); void pthread_exit (void *__retval); // 等待线程结束 int pthread_join (pthread_t __th, void **__thread_return); // 分离线程 int pthread_detach (pthread_t __th); // 请求线程取消 int pthread_cancel (pthread_t __th);
线程属性
enum { PTHREAD_CREATE_JOINABLE, PTHREAD_CREATE_DETACHED }; int pthread_attr_init (pthread_attr_t *__attr); int pthread_attr_destroy (pthread_attr_t *__attr); // 分离状态 int pthread_attr_getdetachstate (const pthread_attr_t *__attr, int *__detachstate); int pthread_attr_setdetachstate (pthread_attr_t *__attr, int __detachstate); // 自定义栈 int pthread_attr_getstack (const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr, size_t *__restrict __stacksize); int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, size_t __stacksize); // 自定义栈大小 int pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr, size_t *__restrict __stacksize); int pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize); // 扩展栈大小(警戒区) int pthread_attr_getguardsize (const pthread_attr_t *__attr, size_t *__guardsize); int pthread_attr_setguardsize (pthread_attr_t *__attr, size_t __guardsize);
可重入和线程安全
线程特定数据(线程私有数据)
标签:equal ack val 例子 oid ddr gets 多次 信号处理
原文地址:http://www.cnblogs.com/mfmans/p/6908098.html