Книга: Programming with POSIX® Threads
6.6.2 Signal masks
6.6.2 Signal masks
int pthread_sigmask (int how, const sigset_t *set, sigset_t *oset);
Each thread has its own private signal mask, which is modified by calling pthread_sigmask
. Pthreads does not specify what sigprocmask
does within a threaded process — it may do nothing. Portable threaded code does not call sigprocmask
. A thread can block or unblock signals without affecting the ability of other threads to handle the signal. This is particularly important for synchronous signals. It would be awkward if thread A were unable to process a SIGFPE because thread B was currently processing its own SIGFPE or. even worse, because thread C had blocked SIGFPE. When a thread is created, it inherits the signal mask of the thread that created it — if you want a signal to be masked everywhere, mask it first thing in main.
- 6.6 Signals
- LOCK SIGNAL
- 6.4.1 Wait-and-Signal Synchronization
- 6.4.2 Multiple-Task Wait-and-Signal Synchronization
- 8.4 Signals
- 8.4.1 Signal Control Blocks
- 8.4.2 Typical Signal Operations
- 8.4.3 Typical Uses of Signals
- 15.6.2 Asynchronous Event Notification Using Signals
- 10.3. Стандартные сигналы С: signal() и raise()
- 10.3.1. Функция signal()
- Использование функции SignalObjectAndWait