5.3.6. Signals

Signals are the traditional method of asynchronous communication between tasks, in which no data is transferred. A signal handler is an expression attached to an operating system signal, which is delivered asynchronously to the running program. A signal handler is attached by a call to the signal function.

A signal pre-empts any activity except garbage collection, and causes control flow to enter the signal handler. The signal handler should not call non-reentrant functions. It is safe for a signal handler to make a call to the error function, which will throw flow control to the nearest error handler.

Gamma supports the following signals:

SIGABRT, SIGBUS, SIGCHLD, SIGCONT, SIGDEV,
SIGEMT, SIGFPE, SIGHUP, SIGILL, SIGINT,
SIGIO, SIGIOT, SIGKILL, SIGNAL_HANDLERS,
SIGPIPE, SIGPOLL, SIGPWR, SIGQUIT, SIGSEGV,
SIGSTOP, SIGSYS, SIGTERM, SIGTRAP, SIGTSTP,
SIGTTIN, SIGTTOU, SIGURG, SIGUSR1, SIGUSR2,
SIGWINCH
	  

For the description of signal values see the signal entry in the Reference Manual.

5.3.6.1. block_signal & unblock_signal

There are times when certain portions of code must not be interrupted by certain or all signals. Use the block_signal and unblock_signal functions to protect a process.