Sybase libraries install signal handlers for synchronous signals in the traditional fashion. For asynchronous signal handling, the libraries use a dedicated thread that calls sigwait to wait for signals.
Use Sybase-provided library calls to install signal handlers for asynchronous signals. Sybase cannot guarantee results if you install signal handlers using other methods. Also take the following precautions:
Because Sybase libraries handle asynchronous signals using sigwait, mask asynchronous signals in all of an application’s threads.
If you mask asynchronous signals or call a Sybase-provided initialization routine such as ct_init or srv_init before spawning any threads, you ensure that asynchronous signals are masked in all threads spawned subsequently.
Signal handlers for asynchronous signals do not run at an interrupt level. On platforms that do not support native threads, make sure that no thread runs in a tight loop. When a signal occurs, Sybase’s internal signal-handler thread must be able to run and to execute the signal handler.
Internally, Sybase libraries use the SIGUSR1 signal. Make sure that no other thread in the application or in another library linked to the application calls sigwait for SIGUSR1.
Some applications may be linked with a Sybase library and with another library, such as a third-party API, that uses sigwait to handle asynchronous signals. In such a case, do not use Sybase-provided calls to install handlers for asynchronous signals handled by the other library.
In a Sybase library, the signal-handler thread calls sigwait only for SIGUSR1 and for the asynchronous signals it monitors. No conflict occurs if another library monitors asynchronous signals not handled by the Sybase libraries.