Unlock Pointer-Based Mutex (UNLKMTX)


Op Code (Hex) Operand 1 Operand 2

03D6 Mutex Result

Operand 1: Space pointer.

Operand 2: Signed binary(4) variable scalar.

Bound program access

Built-in number for UNLKMTX is 158. UNLKMTX ( mutex : address ) : signed binary(4) /* result */

Note: The term "mutex" in this instruction refers to a "pointer-based mutex".

Description

The mutex, whose address is contained in operand 1, is released (unlocked).

The mutex must be aligned on a 16-byte boundary.

The mutex must have been previously created by the CRTMTX instruction or be a copy of a mutex that was previously created by the CRTMTX instruction, and must be currently allocated to the issuer by means of a successful LOCKMTX instruction. See the CRTMTX instruction for additional information regarding mutex copies. An EPERM error number is returned if the mutex is not locked by the requesting thread.

Result is used to indicate the success or failure of the UNLKMTX instruction. If a non-recursive mutex is unlocked by this instruction, then result is set to 0. If the mutex has been recursively locked, this instruction will release one lock and result is set to a negative number whose absolute value is the number of locks which still remain on the mutex, if not 0. See the LOCKMTX instruction for additional information on using the recursive behavior of a mutex.

If an error occurs, then the result is set to an error number.

An EINVAL error number is returned if the mutex has not been initialized, or if it has been altered. The ETYPE error number is returned if the mutex operand references a synchronization object that is not a pointer-based mutex.

Authorization Required

Lock Enforcement

Error conditions

The result is set to one of the following:

EINVAL

3021 - The value specified for the argument is not correct.

EPERM

3027 - Operation not permitted.

ETYPE

3493 - Object type mismatch.

A synchronization object at this address is not a pointer-based mutex.

Exceptions

06 Addressing

08 Argument/Parameter

10 Damage Encountered

1C Machine-Dependent

20 Machine Support

22 Object Access

24 Pointer Specification

2E Resource Control Limit

36 Space Management

44 Protection Violation