Jun 13, 2015 at 5:21am UTC
Hi. I do not understand this function. It says in the reference manuals that it wakes up/unblocks blocked threads. Now what does this mean? Help me understand by the code below pls
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
extern "C" *void task1(*void x);
extern "C" *void task2(*void x);
declare mutex
declare cond
int main(){
declare thread_a, thread_b;
//
//create thread_a and thread_b
//join thread_a and thread_b
//destroy cond
}
void * task1 ((int *)x){
//send signal pthread_cond_signal(...)
//lock mutex
//wait
//some code
//unlock mutex
}
void * task2 ((int *)x){
//lock mutex
//wait
//some code
//unlock mutex
//send signal pthread_cond_signal(...)
}
so signal is sending sinal to what exactly?
thanks
Last edited on Jun 13, 2015 at 5:26am UTC
Jun 16, 2015 at 12:32pm UTC
Last edited on Jun 16, 2015 at 12:36pm UTC