心心程序博客

眼过千遍不如手过一遍! 书看千行不如手敲一行! 手敲千行不如单步一行! 单步源代码千行不如单步对应汇编一行!

导航

2012年4月23日

linux 互斥锁

摘要: #include <assert.h>#include <errno.h>#include <stdio.h>#include <stdlib.h>#include <time.h>#include <pthread.h>#define __FUNC__ __func__pthread_mutex_t hMutex = PTHREAD_MUTEX_INITIALIZER;void *threadFunc1(void *arg){ while(1) { pthread_mutex_lock(&hMutex); ... 阅读全文

posted @ 2012-04-23 09:24 心心程序博客 阅读(2991) 评论(0) 推荐(0) 编辑