X-Git-Url: http://git.harvie.cz/?p=mirrors%2FPrograms.git;a=blobdiff_plain;f=c%2Fpthread_extra%2Fpthread_pause.c;h=e11a0531e3d645496da4822a9a828c8a046f096f;hp=d168121f20e6fb986440380865beb5bbe2cb2867;hb=86166123aef3c81e6e05cd6dcdc73ea93b5775a1;hpb=8df6da88c80f10cb96ed53233ce6c4d414368059 diff --git a/c/pthread_extra/pthread_pause.c b/c/pthread_extra/pthread_pause.c index d168121..e11a053 100644 --- a/c/pthread_extra/pthread_pause.c +++ b/c/pthread_extra/pthread_pause.c @@ -59,7 +59,8 @@ void pthread_pause_disable() { int pthread_pause_reschedule(pthread_t thread) { //Send signal to initiate pause handler - while(pthread_kill(thread, PTHREAD_XSIG_STOP) == EAGAIN) usleep(1000); + //while(pthread_kill(thread, PTHREAD_XSIG_STOP) == EAGAIN) usleep(1000); + while(pthread_sigqueue(thread, PTHREAD_XSIG_STOP, (const union sigval){.sival_ptr=NULL}) == EAGAIN) usleep(1000); return 0; }