pthread_pause pthread_unpause
[mirrors/Programs.git] / c / pthread_extra / pthread_pause.c
CommitLineData
a8e71e8f
TM
1#include <pthread.h>
2#include <pthread_extra.h>
3#include <signal.h>
4
5void pthread_unpause_handler() {
6 //NOP
7}
8
9void pthread_pause_handler() {
10 sigset_t sigset;
11 sigfillset(&sigset);
12 sigdelset(&sigset, PTHREAD_XSIG_CONT);
13 sigsuspend(&sigset);
14}
15
16void pthread_pause_enable() {
17 signal(PTHREAD_XSIG_STOP, pthread_pause_handler);
18 signal(PTHREAD_XSIG_CONT, pthread_unpause_handler);
19}
This page took 0.092884 seconds and 4 git commands to generate.