Op Code (Hex) | Operand 1 | Operand 2 | ||
---|---|---|---|---|
03D6 | Mutex | Result |
Operand 1: Space pointer.
Operand 2: Signed binary(4) variable scalar.
Bound program access |
---|
|
Note: The term "mutex" in this instruction refers to a "pointer-based mutex".
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.
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. |
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