示例#1
0
文件: b_k.cpp 项目: filaPro/my
void *thread(void *pManager){
	Manager *mgr = (Manager*)pManager;
 	do{
		Calc *c = mgr->give_else();
 		if(c != NULL){
			c->func(c);
			c->m->i_am_done(c);
		}else
			break;
	}while(1);
	return NULL;
}   
示例#2
0
文件: a.cpp 项目: filaPro/my
void *thread(void *parasha){
	Manager *mgr = (Manager*)parasha;
	do{
		Calc *c = mgr->day_eshe();
		if(c != NULL){
			c->func(c);
			c->m->i_am_done(c);
		}else
			break;
	}while(1);

	return NULL;
}
示例#3
0
文件: a.cpp 项目: filaPro/my
void *thread(void *parasha){
	Manager *mgr = (Manager*)parasha;
	long int t = get_time();
	do{
		Calc *c = mgr->dai_eshe();
		if(c != NULL){
			c->func(c);
			c->m->i_am_done(c);
		}else
			break;
	}while(1);

	pthread_mutex_lock(&mgr->mx);
	cerr << "thread usage: " << (get_time() - t) << endl;
	pthread_mutex_unlock(&mgr->mx);

	return NULL;
}