使用互斥量读写链表
时间:2010-10-29 来源:juxiangwu
/*
* main.c
*
* Created on: Oct 29, 2010
* Author: jenson
*/
#include
#include
#include
#include
#include
#include
typedef struct _list_args * list_args;
struct _list_args {
list_t * list;
int value;
};
pthread_mutex_t q_lock = PTHREAD_MUTEX_INITIALIZER;//全局变量锁
struct timeval begintime;
void * pop_list(void * list) {
pthread_t tid;
tid =pthread_self();
printf(\
* main.c
*
* Created on: Oct 29, 2010
* Author: jenson
*/
#include
#include
#include
#include
#include
#include
typedef struct _list_args * list_args;
struct _list_args {
list_t * list;
int value;
};
pthread_mutex_t q_lock = PTHREAD_MUTEX_INITIALIZER;//全局变量锁
struct timeval begintime;
void * pop_list(void * list) {
pthread_t tid;
tid =pthread_self();
printf(\
相关阅读 更多 +