[Prev] [Contents] [Next]

Pthread APIs cause asynchronous signals initialization

When a job is running in OS/400, by default it is not enabled for Posix signals. The system will never deliver a Posix signal to a job that is not enabled for signals.

The job is initialized for signals with the default Posix signals environment when any thread in the job calls any API defined to implicitly enable signals. The main categories of APIs that enable signals are the signals APIs themselves and some process related APIs related to signals. For example, some of the apis that enable signals are: Qp0sEnableSignals(), kill(), sigaction(), sigprocmask(), getpid(), and spawn(). After the initialization for signals occurs within a job, the system can deliver signals to that job if they are generated by another job or the system.

When a program in a job uses pthreads, that job is automatically enabled for signals when the pthreads service program is loaded (either dynamically or statically). Loading the service program that contains the pthread APIs causes the job to be initialized for signals, regardless if the application actually calls the pthread APIs or not. All pthread programs can implicitly receive signals if another job or the system generates a signal for the threaded job.

If the application calls Qp0sDisableSignals() to disable signals for the job, the Pthreads APIs will not function correctly. Do not use Qp0sDisableSignals() in a threaded job.

For more information about signals and the APIs mentioned in this section, see the "Signal APIs" and "Process-Related APIs" chapter of the "Unix Type APIs" part of the System API Reference.



[Prev] [Contents] [Next]
Copyright © 1998, IBM Corporation. All rights reserved.
Comments? Contact
rchthrds@us.ibm.com