Unlock Object (UNLOCK)


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
Bits 4-5



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


14 E
Reserved (binary 0)
Bits 6-7
14 E
Lock scope
Bit 8



0 = Lock is scoped to the lock scope object type.
1 = Lock is scoped to the current thread.


14 E
Lock scope object type
Bit 9



0 = Process containing the current thread.
1 = Transaction control structure attached to the current thread.


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


14 E Reserved (binary 0) Bits 12-15
16 10
Object(s) to unlock
[*] System pointer



(one for each unlock request)


* *
--- 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
[*] Char(1)



(repeated for unlock request)


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
Bit 5



0 = Lock count reduced by 1
1 = All locks are unlocked. The lock count is set to 0.


0 0
Reserved (binary 0)
Bit 6 +
0 0
Entry active indicators
Bit 7



0 = Entry not active. This entry is not used.
1 = Entry active. These locks are unlocked.


* *
--- 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

Lock Enforcement

Exceptions

06 Addressing

08 Argument/Parameter

0A Authorization

10 Damage Encountered

1A Lock State

1C Machine-Dependent

20 Machine Support

22 Object Access

24 Pointer Specification

2E Resource Control Limit

36 Space Management

38 Template Specification

44 Protection Violation