您的位置:首页 > 其它

Usage sample of unix mutex and conditional

2010-01-10 14:16 555 查看
pthread_mutex_init

pthread_mutex_destroy

pthread_mutex_t

pthread_mutex_lock

pthread_mutex_unlock

pthread_mutex_trylock

pthread_cond_t _cond;

retVal = pthread_cond_init(&_cond,
0);

retVal = pthread_cond_signal(&_cond);

retVal =
pthread_cond_wait(&_cond, &(mutex));

retVal =
pthread_cond_timedwait(&_cond, &(m
utex), &abstime);

retVal =
pthread_cond_broadcast(&_cond);

pthread_cond_destroy(&_cond);

pthread_mutex_t singletonMutex =
PTHREAD_MUTEX_INITIALIZER;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: