From 86166123aef3c81e6e05cd6dcdc73ea93b5775a1 Mon Sep 17 00:00:00 2001 From: Tomas Mudrunka Date: Wed, 30 Jun 2021 15:15:26 +0200 Subject: [PATCH] Predavani pointeru se signalem --- c/pthread_extra/pthread_pause.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.30.2