Unlock Object (UNLOCK)

Instruction Syntax

Op Code (Hex) Operand 1
03F1 Unlock template
Operand 1: Space pointer.

Bound Program Access
Built-in number for UNLOCK is 55.
UNLOCK (
        unlock_template   : address
)

Description:

The instruction releases the object locks that are specified in the unlock template. The template specified by operand 1 identifies the system objects and the lock states (on those objects) that are to be released. The unlock template must be aligned on a 16-byte boundary. The format is as follows:

Offset  
Dec Hex Field Name Data Type and Length
0 0 Number of unlock requests in template Bin(4)
4 4 Offset to lock state selection bytes Bin(2)
6 6 Reserved Char(8) +
14 E Unlock options Char(2)
14 E
  • Reserved
  • Bits 0-3 +
14
E
  • Unlock type
    00 =
    Unlock specific locks now allocated to process, thread, or transaction control structure
    01 =
    Cancel specific asynchronously waiting lock request for the current thread, or release allocated locks for the current thread or its containing process
    10 =
    Cancel all asynchronously waiting lock requests for current thread
    11 =
    Invalid

  • Bits 4-5
14 E
  • Reserved (binary 0)
  • Bits 6-7
14
E
  • Lock scope
    0 =
    Lock is scoped to the lock scope object type.
    1 =
    Lock is scoped to the current thread.

  • Bit 8
14
E
  • Lock scope object type
    0 =
    Process containing the current thread.
    1 =
    Transaction control structure attached to the current thread.

  • Bit 9
14 E
  • Reserved (binary 0)
  • Bit 10
14
E
  • Reverse unlock option
    0 =
    Unlocks will be performed in template order.
    1 =
    Unlocks will be performed in reverse template order.

  • Bit 11
14 E
  • Reserved (binary 0)
  • Bits 12-15
16
10
Object(s) to unlock
(one for each unlock request)
[*] System pointer
*
*
--- End ---
 

The unlock options is located by adding the offset to lock state selection bytes above to operand 1.

Offset  
Dec Hex Field Name Data Type and Length
0
0
Unlock options
(repeated for unlock request)
[*] Char(1)
0 0
  • Lock state to unlock (only one state can be selected) (1 = unlock)
  • Bits 0-4
0 0
    • LSRD
    • Bit 0
0 0
    • LSRO
    • Bit 1
0 0
    • LSUP
    • Bit 2
0 0
    • LEAR
    • Bit 3
0 0
    • LENR
    • Bit 4
0
0
  • Lock count option
    0 =
    Lock count reduced by 1
    1 =
    All locks are unlocked. The lock count is set to 0.

  • Bit 5
0 0
  • Reserved (binary 0)
  • Bit 6 +
0
0
  • Entry active indicators
    0 =
    Entry not active. This entry is not used.
    1 =
    Entry active. These locks are unlocked.


  • Bit 7
*
*
--- End ---
 
Note: Fields indicated by a plus sign (+) are ignored by the instruction.

The unlock type field specifies if locks are to be released or outstanding lock requests are to be canceled.

If all asynchronous lock waits are being canceled (unlock type specified as 10 ), then objects to unlock and unlock options for each object are not required. If the asynchronous lock fields are provided in the template, then the data is ignored.

Specifying 01 for unlock type attempts to cancel an asynchronous lock request that is identical to the one defined in the template. After the instruction attempts to cancel the specified request, program execution continues just as if 00 had been specified for unlock type. A waiting lock request is canceled if the number of active requests in the template, the objects, the objects corresponding lock states, and the order of the active entries in the template all match.

When a lock is released, the lock count is reduced by 1 or set to 0 in the specified state. This option is specified by the lock count option parameter.

If 01 is specified for unlock type and the lock count option for an object lock is 0 (lock count reduced by 1), then a successful cancel satisfies this request, and no additional locks on the object are unlocked. If the lock count option for an object lock is set to 1 (set lock count to 0), the results of the cancel are disregarded, and all held locks on the object are unlocked.

Specific locks can be unlocked only if they are allocated to the process, thread, or the transaction control structure attached to the thread issuing the unlock instruction. The lock scope specified by lock scope and lock scope object type must also match the scope of the locks currently allocated for the process, thread, or the transaction control structure. If lock scope object type has a value of transaction control structure attached to the current thread and a transaction control structure is not attached to the current thread, the lock must be allocated to the process containing the current thread.

Implicit locks may not be unlocked with this instruction. No locks are unlocked if an entry in the template is invalid.

Object locks to unlock are processed sequentially and individually.

The order of the unlock can be specified by the reverse unlock option field. A value of binary 0 is the default and indicates that unlocks will be performed in template order. A value of binary 1 indicates that the unlocks will be performed in reverse template order.

If one specific object lock cannot be unlocked because the process, thread, or the transaction control structure does not hold the indicated lock on the object, then exception data is saved, but processing of the instruction continues.

After all requested object locks have been processed, the invalid unlock request (hex 1A03) exception is signaled if any object lock was not unlocked.

If 01 is specified for unlock type and the cancel attempt is unsuccessful, an invalid unlock request (hex 1A03) exception is signaled when any object lock in the template is not unlocked.

Authorization Required

  • Execute
    • Contexts referenced for address resolution

Lock Enforcement

  • Materialize
    • Contexts referenced for address resolution

Exceptions

  • 06 Addressing
    • 0601 Space Addressing Violation
    • 0602 Boundary Alignment
    • 0603 Range
  • 08 Argument/Parameter
    • 0801 Parameter Reference Violation
  • 0A Authorization
    • 0A01 Unauthorized for Operation
  • 10 Damage Encountered
    • 1004 System Object Damage State
    • 1005 Authority Verification Terminated Due to Damaged Object
    • 1044 Partial System Object Damage
  • 1A Lock State
    • 1A01 Invalid Lock State
    • 1A03 Invalid Unlock Request
  • 1C Machine-Dependent
    • 1C03 Machine Storage Limit Exceeded
  • 20 Machine Support
    • 2002 Machine Check
    • 2003 Function Check
  • 22 Object Access
    • 2201 Object Not Found
    • 2202 Object Destroyed
    • 2203 Object Suspended
    • 2205 Object Not Available to Process
    • 2207 Authority Verification Terminated Due to Destroyed Object
    • 2208 Object Compressed
    • 220B Object Not Available
  • 24 Pointer Specification
    • 2401 Pointer Does Not Exist
    • 2402 Pointer Type Invalid
  • 2E Resource Control Limit
    • 2E01 User Profile Storage Limit Exceeded
  • 36 Space Management
    • 3601 Space Extension/Truncation
  • 38 Template Specification
    • 3801 Template Value Invalid
  • 44 Protection Violation
    • 4401 Object Domain or Hardware Storage Protection Violation