pthread_setintrtype (BPX1PST, BPX4PST) — Examine and change the interrupt type

Function

The pthread_setintrtype callable service sets the specified interruptability type of the calling thread and atomically returns the previous interruptability type.

Requirements

Operation Environment
Authorization: Supervisor state or problem state, any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
AMODE (BPX1PST): 31-bit
AMODE (BPX4PST): 64-bit
ASC mode: Primary mode
Interrupt status: Enabled for interrupts
Locks: Unlocked
Control parameters: All parameters must be addressable by the caller and in the primary address space.

Format

CALL BPX1PST,(Interrupt_type,
              Return_value,
              Return_code,
              Reason_code)

AMODE 64 callers use BPX4PST with the same parameters.

Parameters

Interrupt_type
Supplied parameter
Type:
Structure
Length:
Fullword
The name of a fullword containing a numeric value identifying the interrupt type to be set. The following constants, which are defined in BPXYCONS, define the valid states.
Constant Description
PTHREAD_INTR_ASYNCHRONOUS# When interruptability is enabled and the interruptability type is set to PTHREAD_INTR_ASYNCHRONOUS#, cancelation requests can be acted upon at any time.
PTHREAD_INTR_CONTROLLED# When interruptability is enabled and the interruptability type is set to PTHREAD_INTR_CONTROLLED#, cancelation requests are held pending until a cancelation point is reached. See the usage notes for a definition of cancelation points.
Return_value
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword to which the service returns the previous interrupt type, or -1 if the service did not complete.

Return_code
Returned parameter
Type:
Integer
Length:
Fullword
The name of a fullword in which the pthread_setintrtype service stores the return code. The pthread_setintrtype service returns Return_code only if Return_value is -1. For a complete list of possible return code values, see z/OS UNIX System Services Messages and Codes. The pthread_setintrtype service can return the following value in the Return_code parameter:
Return code Explanation
EINVAL One of the parameters contains a value that is not valid.
Reason_code
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the pthread_setintrtype service stores the reason code. The pthread_setintrtype service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.

Usage notes

  1. The default interrupt type for newly created threads and the initial thread is PTHREAD_INTR_CONTROLLED#. If a cancelation request is pending and the interrupt state is set to PTHREAD_INTR_AYNCHRONOUS#, the cancelation request is acted upon before control is returned to the invoker.
  2. For more information about controlling cancelation requests, see the usage notes for pthread_setintr (BPX1PSI, BPX4PSI) — Examine and change the interrupt state.
  3. See Optimizing performance using process- and thread-level information.

Related services

Characteristics and restrictions

There are no restrictions on the use of the pthread_setintrtype service.

Examples

For an example using this callable service, see BPX1PST (pthread_setintrtype) example.