Pthread多线程编程之互斥量与条件变量的使用

一、 互斥量(Mutex Variables)

Creating and Destroying Mutexes

int pthread_mutex_init(pthread_mutex_t *restrict, const pthread_mutexattr_t *restrict);
// 初始化互斥锁

int pthread_mutex_destroy(pthread_mutex_t *);
// 删除互斥锁

int pthread_mutexattr_init(pthread_mutexattr_t *);
// 初始化互斥锁属性

int pthread_mutexattr_destroy(pthread_mutexattr_t *);
// 删除互斥锁属性

Continue reading