UNLOCK (Unlock Resource) Macro

The macro can be used to:
  • Dequeue the issuing task (or partition) from the named resource (to which the task had previously been queued by a LOCK macro). The resource must be defined to the system by a DTL or GENDTL macro.
  • Lower the lock control level. This can be done only, if the issuing task is locked, onto the resource, with the most stringent control level: CONTROL=E and LOCKOPT=1 (the CONTROL and LOCKOPT operands are described with the DTL macro). The resource then continues to be held by the task. However, another task that waits for this resource can be dispatched again and gain shared access (see also the description of the LOCK (Lock a Resource) Macro). To use the UNLOCK macro for this purpose, you must issue the MODDTL macro with CHANGE=ON.

Format

Read syntax diagramSkip visual syntax diagramnameUNLOCKname(S, name)(1)ALL

Requirements for the caller

AMODE:
24 or 31
RMODE:
24 or ANY
ASC Mode:
Primary

Parameters

name | (S,name) | (1)
Specifies the DTL address.
ALL
Frees all resources, which are locked by the task and whose DTLs were defined with KEEP=NO. If UNLOCK ALL is issued by the main task, not only the resources that are locked by that task are unlocked, but also those, which are locked by subtasks, with OWNER=PARTITION specified for DTL generation.

Return Codes in Register 15

0
Successful request; the resource is unlocked.
4
The resource is not locked for the unlocking task.
8
DTL format error.
Note: UNLOCK ALL does not provide a return code, and register 15 remains unchanged.