Example #1
0
File: b_k.cpp Project: 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;
}   
Example #2
0
File: a.cpp Project: 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;
}
Example #3
0
File: a.cpp Project: 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;
}