docs
[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);
ae4849d1 14 //int sig; sigwait(&sigset, &sig);
a8e71e8f
TM
15}
16
17void pthread_pause_enable() {
18 signal(PTHREAD_XSIG_STOP, pthread_pause_handler);
19 signal(PTHREAD_XSIG_CONT, pthread_unpause_handler);
20}
This page took 0.114607 seconds and 4 git commands to generate.