Galaxy Communicator Documentation:

Signal Handling

License / Documentation home / Help and feedback

Signal handling is complicated by threads. In order to enforce the proper signal handling across threaded and non-threaded applications, we provide a simple interface to signal handling which hides the appropriate details. It is strongly recommended that you use this interface to install signal handlers.

void Gal_InitializeSignals()
This function is called by GalSS_CmdlineInitializeServer and GalSS_InitializeServerToplevel. In the non-threaded environment, it does nothing; if threads are enabled, it sets up a separate thread for signal handling and enables a few default handlers.

int Gal_SignalsInitialized()
Returns 1 if signals have been initialized. In the non-threaded case, always returns 1.

void Gal_AddSignalHandler(int sig, void (handler)(int ))
This function is like calling signal(), except it handles signals appropriately in threaded contexts. It supports the System V interpretation of signal(), whereby the signal handler is cleared after the signal is caught. If you want the signal to be caught again, you must call Gal_AddSignalHandler() inside your signal handler. This function will do the right thing inside _GalSS_init_server and _GalSS_InitializeDefaults. (although in the threaded case, no signals can be counted on to be handled appropriately until immediately before _GalSS_init_server is called).

License / Documentation home / Help and feedback
Last updated August 3, 2000