Creating a latch set (ISGLCRT and ISGLCR64 services)
Applications can call the Latch_Create service to create a latch set during initialization or whenever latches are required. The system keeps each latch set in storage with a protection key that matches the PSW key of the caller of Latch_Create.
The caller of Latch_Create must specify:
- The number of latches to be contained in the latch set (see Specifying the number of latches in a latch set).
- A name that uniquely identifies the latch set within the current primary address space (see Identifying latch sets).
If you want the latch obtain services to detect some simple latch
deadlock situations, you can specify the ISGLCRT_DEADLOCKDET1 or ISGLCRT_DEADLOCKDET2 option
on the ISGLCRT service. The following deadlock situations can be detected:
- The work unit requests exclusive ownership of a latch that the work unit already owns exclusively.
- The work unit requests shared ownership of a latch that the work unit already owns exclusively.
- The work unit requests exclusive ownership of a latch for which the work unit already holds a shared ownership.
Once you create a latch set, the latch set remains in place for the life of the job or address space. You cannot delete a latch set.