Commit | Line | Data |
---|---|---|
a8e71e8f TM |
1 | #include <pthread.h> |
2 | #include <pthread_extra.h> | |
3 | #include <signal.h> | |
4 | ||
5 | void pthread_unpause_handler() { | |
6 | //NOP | |
7 | } | |
8 | ||
9 | void pthread_pause_handler() { | |
10 | sigset_t sigset; | |
11 | sigfillset(&sigset); | |
12 | sigdelset(&sigset, PTHREAD_XSIG_CONT); | |
13 | sigsuspend(&sigset); | |
ae4849d1 | 14 | //int sig; sigwait(&sigset, &sig); |
a8e71e8f TM |
15 | } |
16 | ||
17 | void pthread_pause_enable() { | |
18 | signal(PTHREAD_XSIG_STOP, pthread_pause_handler); | |
19 | signal(PTHREAD_XSIG_CONT, pthread_unpause_handler); | |
20 | } |