Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (T-V)
Guardian Procedure Calls Reference Manual522629-013
15-24
UNLOCKREC Procedure
Parameters
filenum input
INT:value
is the number of an open file that identifies the file containing the record to be
unlocked.
tag input
INT(32):value
is for nowait I/O only.
tag is a value you define that uniquely identifies the
operation associated with this UNLOCKREC.
Condition Code Settings
< (CCL) indicates that an error occurred (call FILE_GETINFO_ or FILEINFO).
= (CCE) indicates that the UNLOCKREC is successful.
> (CCG) indicates that the file is not a disk file.
Considerations
File-opened nowait and UNLOCKREC
The UNLOCKREC procedure must complete with a corresponding call to the
AWAITIO[X] procedure when used with a file that is opened nowait.
Queuing processes and UNLOCKREC
If any users are queued in the locking queue for the record, the user at the head of
the locking queue is granted access and is removed from the queue (the next read
or lock request moves to the head of the queue).
If the user granted access is waiting to lock the record, it is granted the lock (which
excludes other process from accessing the record) and resumes processing.
If the user granted access is waiting to read the record, its read is processed.
Calling UNLOCKREC after KEYPOSITION
If the call to UNLOCKREC immediately follows a call to KEYPOSITION where a
nonunique alternate key is specified, the UNLOCKREC fails. A subsequent call to
FILE_GETINFO_ or FILEINFO shows that error 46 (invalid key) occurred.
However, if an intermediate call to READ or READLOCK is performed, the call to
UNLOCKREC is permitted.
Note. The system stores this tag value until the I/O operation completes. The system then
returns the tag information to the program in the tag parameter of the call to AWAITIO[X],
thus indicating that the operation completed.