静态锁
头文件:
#include <pthread.h>
定义:
static pthread_mutex_t destruct_mutex = PTHREAD_MUTEX_INITIALIZER;
使用:
pthread_mutex_lock(&destruct_mutex);
pthread_mutex_unlock(&destruct_mutex);
头文件:
#include <pthread.h>
定义:
static pthread_mutex_t destruct_mutex = PTHREAD_MUTEX_INITIALIZER;
使用:
pthread_mutex_lock(&destruct_mutex);
pthread_mutex_unlock(&destruct_mutex);