From: Tomas Mudrunka Date: Wed, 30 Jun 2021 13:15:26 +0000 (+0200) Subject: Predavani pointeru se signalem X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=86166123aef3c81e6e05cd6dcdc73ea93b5775a1;p=mirrors%2FPrograms.git Predavani pointeru se signalem --- 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; }