Syntax
The RELEASE option of the SETLOCK macro is written as follows:
Syntax |
Description |
---|
|
|
name |
name: Symbol. Begin name in
column 1. |
|
|
␢ |
One or more blanks must precede SETLOCK. |
|
|
SETLOCK |
|
|
|
␢ |
One or more blanks must follow SETLOCK. |
|
|
RELEASE |
|
|
|
,TYPE=CPU |
|
,TYPE=CMS |
|
,TYPE=LOCAL |
|
,TYPE=CML,ASCB=(11) |
|
,TYPE=CML,ASCB=addr |
addr: A-type address |
|
|
,REGS=SAVE |
|
,REGS=USE |
|
,REGS=STDSAVE |
|
|
|
,RELATED=value |
value: Any valid macro keyword
specification. |
|
|
Parameters
The parameters are explained as follows:
- RELEASE
- Specifies that the lock designated by the TYPE parameter is to
be released.
Note: If you specify RELEASE,TYPE=CML,ASCB=(11) or ASCB=addr,
the ASCB parameter specifies the home address space, and the lock
that the caller holds is home's local lock, then SETLOCK processing
treats the CML release request as a RELEASE, TYPE=LOCAL.
- ,TYPE=CPU
- ,TYPE=CMS
- ,TYPE=LOCAL
- ,TYPE=CML,ASCB=(11)
- ,TYPE=CML,ASCB=addr
- Specifies the type of lock. The types available are:
- CPU
- The processor lock. It is a pseudo spin lock providing MVS-recognized
disablement. There is one CPU lock per processor and no processor
can request another processor's lock. The lock is always available.
Users can obtain the CPU lock to become disabled for I/O and external
interrupts.
- CMS
- The cross memory services lock. It is a global suspend lock used
to serialize functions between address spaces.
- LOCAL
- The lock that serializes resources in the home address space pointed
to by PSAAOLD. It is a local level suspend lock.
- CML
- The cross memory local lock. It is a local level suspend type
lock used to serialize resources in an address space other than the
home address space.
The requestor of a CML lock must have authority
to access the specified address space before requesting the lock.
To establish authority, the requestor sets the primary or secondary
address space to the one specified by the ASCB=(11) or ASCB=addr parameter.
Register 11 or addr must contain the address of
the ASCB whose local lock is requested. This address space must be
nonswappable before the SETLOCK request.
Note: If the requestor
specifies OBTAIN,TYPE=CML and the ASCB parameter points to the home
address space, the request is treated as though the LOCAL lock were
being obtained.
- ,REGS=SAVE
- ,REGS=USE
- ,REGS=STDSAVE
- Specifies the use of general purpose registers by the SETLOCK
macro.
- SAVE
- Specifies that the contents of registers 11 through 14 are saved
in the area pointed to by register 13 and are restored upon completion
of the SETLOCK request. This save area must be at least 20 bytes,
and must not be the same area as the standard linkage save area used
by the program.
Upon completion of the SETLOCK macro with REGS=SAVE,
the register contents are as follows: - Register
- Contents
- 0-14
- Unchanged
- 15
- Return code
- USE
- Specifies that the contents of registers 11 through 13 are saved
in work registers 0, 1, and 15.
Upon completion of the SETLOCK
macro with REGS=USE, the register contents are as follows: - Register
- Contents
- 0-1
- Used as work registers by the system
- 2-13
- Unchanged
- 14
- Used as a work register by the system
- 15
- Return code
- STDSAVE
- Specifies that the contents of registers 2 through 12 are saved
in a standard 72-byte save area pointed to by register 13.
Upon
completion of the SETLOCK macro with REGS=STDSAVE, the register contents
are as follows: - Register
- Contents
- 0-1
- Unchanged
- 2-13
- Unchanged
- 14
- Used as a work register by the system
- 15
- Return code
- ,RELATED=value
- Specifies information used to self-document macros by “relating”
functions or services to corresponding functions or services. The
format and contents of the information specified are at the discretion
of the user, and may be any valid coding values.
Return and reason codes
When control is returned, register 15 (or register 13, if the REGS
parameter is not specified) contains one of the following hexadecimal
return codes:
Table 1. Return Codes for SETLOCK
RELEASEReturn Code |
Meaning and Action |
---|
00 |
Meaning: The lock was successfully released. Action:
None.
|
04 |
Meaning: The lock was not owned. The lock
was free when the release request was issued. Action: None.
|
08 |
Meaning: The release process was unsuccessful.
The lock was owned by a different processor. Action: None
required. However, you might try to take some action based upon your
application.
|
0C |
Meaning: The release process was unsuccessful.
The caller does not own the specified local or CML lock. This return
code applies to LOCAL or CML release only. Action: None
required. However, you might try to take some action based upon your
application.
|
Example 1
Release the local lock and check the return code from the SETLOCK
request. If the release was unsuccessful, branch to the code at the
RLSEFAIL label. SETLOCK RELEASE,TYPE=LOCAL
LTR 13,13
BNZ RLSEFAIL
Example 2
Release the CML lock, saving the contents of registers 2 through
12 in a standard save area. Check the return code from the SETLOCK
request, and branch to the code at the RLSEFAIL label if the release
was unsuccessful. SETLOCK RELEASE,TYPE=CML,REGS=STDSAVE
LTR 15,15
BNZ RLSEFAIL
|