Predavani pointeru se signalem
authorTomas Mudrunka <tomas@mudrunka.cz>
Wed, 30 Jun 2021 13:15:26 +0000 (15:15 +0200)
committerTomas Mudrunka <tomas@mudrunka.cz>
Wed, 30 Jun 2021 13:15:26 +0000 (15:15 +0200)
c/pthread_extra/pthread_pause.c

index d168121f20e6fb986440380865beb5bbe2cb2867..e11a0531e3d645496da4822a9a828c8a046f096f 100644 (file)
@@ -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;
 }
 
This page took 0.15679 seconds and 4 git commands to generate.