Guardian Procedure Calls Reference Manual

Parameters
filenum
input
INT:value
is a number of an open file that identifies the file to be unlocked.
tag
input
INT(32):value
is for nowait I/O only. tag is optional and the value you define uniquely identifies the operation
associated with this UNLOCKFILE.
NOTE: The system stores the 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.
Condition Code Settings
indicates that an error occurred (call FILE_GETINFO_ or FILEINFO).< (CCL)
indicates that the UNLOCKFILE was successful.= (CCE)
indicates that the file is not a disk file.> (CCG)
Considerations
Nowait and UNLOCKFILE
The UNLOCKFILE procedure must complete with a corresponding call to the AWAITIO[X]
procedure when used with a file that is opened nowait.
Locking queue
If any users are queued in the locking queue for the file, the process 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 next user in the locking queue is waiting to:
lock the file or lock a record in the file, it is granted the lock (which excludes other users
from accessing the file) and resumes processing.
read the file, its read is processed.
Transaction Management Facility (TMF) and UNLOCKFILE
Locks on a file audited by TMF which has been modified by the current transaction are released
only when the transaction is ended or aborted by TMF; in other words, a locked audited file
which has been modified by the current transaction is unlocked during an ENDTRANSACTION
or ABORTTRANSACTION processing for that file. An unmodified audited file is unlocked by
UNLOCKFILE.
OSS Considerations
This procedure operates only on Guardian objects. If an OSS file is specified, error 2 is returned
Example
CALL UNLOCKFILE ( SAVE^FILENUM );
1434 Guardian Procedure Calls (T-V)