Use pthread_sigmask() instead of sigprocmask() when pthreads
are enabled.
This commit is contained in:
parent
4fd43cb3a9
commit
8286a60b8f
|
@ -20,6 +20,9 @@
|
||||||
pthread_once(&once_, &func); \
|
pthread_once(&once_, &func); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
# define mythread_sigmask(how, set, oset) \
|
||||||
|
pthread_sigmask(how, set, oset)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
# define mythread_once(func) \
|
# define mythread_once(func) \
|
||||||
|
@ -31,4 +34,7 @@
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
# define mythread_sigmask(how, set, oset) \
|
||||||
|
sigprocmask(how, set, oset)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -109,7 +109,7 @@ signals_block(void)
|
||||||
{
|
{
|
||||||
if (signals_block_count++ == 0) {
|
if (signals_block_count++ == 0) {
|
||||||
const int saved_errno = errno;
|
const int saved_errno = errno;
|
||||||
sigprocmask(SIG_BLOCK, &hooked_signals, NULL);
|
mythread_sigmask(SIG_BLOCK, &hooked_signals, NULL);
|
||||||
errno = saved_errno;
|
errno = saved_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ signals_unblock(void)
|
||||||
|
|
||||||
if (--signals_block_count == 0) {
|
if (--signals_block_count == 0) {
|
||||||
const int saved_errno = errno;
|
const int saved_errno = errno;
|
||||||
sigprocmask(SIG_UNBLOCK, &hooked_signals, NULL);
|
mythread_sigmask(SIG_UNBLOCK, &hooked_signals, NULL);
|
||||||
errno = saved_errno;
|
errno = saved_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#define PRIVATE_H
|
#define PRIVATE_H
|
||||||
|
|
||||||
#include "sysdefs.h"
|
#include "sysdefs.h"
|
||||||
|
#include "mythread.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
Loading…
Reference in New Issue