SignalSet

Signal set struct wrapping the C sigset_t and its setter / getter functions.

Note that, as this is a struct rather than a class, and thus has no constructor, it is necessary to explicitly call the clear() method before using an instance.

Members

Functions

add
void add(int signal)

Adds the specified signal to the set.

add
void add(int[] signals)

Adds the specified signals to the set.

block
typeof(this) block()

Blocks the signals in in the set of this instance in the calling thread. Signals that are not in this set but are already blocked will stay blocked.

callBlocked
void callBlocked(void op)

Executes op with the signals in this set blocked. The signals are automatically unblocked again after op has finished (returned or threw).

clear
void clear()

Clears all signals in the set (i.e. sets to the set of no signals).

isSet
bool isSet(int signal)

Tells whether a signal is in the set.

mask
typeof(this) mask(int how)

Calls pthread_sigmask() with the set of signals of this instance.

opCast
sigset_t opCast()

Cast operator for convenient use of this struct in C functions which accept a sigset_t.

remove
void remove(int signal)

Removes the specified signal from the set.

remove
void remove(int[] signals)

Removes the specified signals from the set.

setAll
void setAll()

Sets to the set of all signals.

unblock
typeof(this) unblock()

Unblocks the signals in in the set of this instance in the calling thread. Signals that are not in this set but are not blocked will stay unblocked.

Static functions

getCurrent
typeof(this) getCurrent()

Gets the signal mask for the calling thread.

Meta