GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
* Sign Up! *

Support
Customer Portal
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
PTHREAD_SIGNALS_BLOCK_NP(3) FreeBSD Library Functions Manual PTHREAD_SIGNALS_BLOCK_NP(3)

pthread_signals_block_np, pthread_signals_unblock_npfast asynchronous signals blocking and unblocking

POSIX Threads Library (libpthread, -lpthread)

#include <pthread_np.h>

void
pthread_signals_block_np(void);

void
pthread_signals_unblock_np(void);

The () and () functions provide user programs an interface to the fast asynchronous signals blocking facility sigfastblock(2).

Blocking signals with () disables delivery of any asynchronous signal, until unblocked. Signal blocking establishes a critical section where the execution flow of the thread cannot be diverted into a signal handler. Blocking signals is fast, it is performed by a single memory write into a location established with the kernel.

Synchronous signal delivery cannot be blocked in general, including with these functions.

The blocked state established by the () is not completely POSIX-compliant. Specifically, system calls executed while in a blocked section, might abort sleep and return EINTR upon queuing of an asynchronous signal to the thread, but the signal handler is not called until the last unblock is done.

Calls to pthread_signals_block_np can be nested, and must be complemented by an equal count of calls to pthread_signals_unblock_np to return the calling thread to the standard mode of signal receiving.

An example use of these function might be the construction of the CPU state that cannot be done atomically, and which includes stages where the state of the thread is not ABI compliant. If a signal is delivered while such state is not yet finished, signal handlers would misbehave. Using standard functions (()) to establish critical section might be much slower, because sigprocmask() is system call, while pthread_signals_block_np() consists of a single atomic memory write.

The functions do not return a value.

There are no errors reported by the functions.

May 16, 2025 FreeBSD 15.1-RELEASE-p1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.