Guardian Procedure Calls Reference Manual

NOTE: For non-audited files, a deadlock condition—a permanent suspension of your
application—occurs if READ or READUPDATE is called by the process which has a record
locked by a filenum other than that supplied in READ or READUPDATE. (For an explanation
of multiple opens by the same process, see the FILE_OPEN_ Procedure (page 457).)
Accessing a locked file
If the file is locked by a user other than the caller at the time of the call, the call is rejected
with file-system error 73 ("file is locked") when:
READ or READUPDATE is called, and the alternate locking mode is in effect.
WRITE, WRITEUPDATE, or CONTROL is called.
A count of the locks in effect is not maintained. Multiple locks can be unlocked with one call
to UNLOCKFILE. For example:
.
CALL LOCKFILE ( FILE^A,...); ! FILE^A becomes locked.
.
CALL LOCKFILE ( FILE^A,...); ! is a null operation,
! because the file is
! already locked. A condition code
! of CCE returns.
.
CALL UNLOCKFILE ( FILE^A,...); ! FILE^A becomes unlocked.
.
CALL UNLOCKFILE ( FILE^A,...); ! is a null operation,
! because the file is
! already unlocked.
! A condition code of
! CCE returns.
OSS Considerations
This procedure operates only on Guardian objects. If an OSS file is specified, error 2 occurs.
Related Programming Manual
For programming information about the LOCKFILE file-procedure, see the Enscribe Programmer's
Guide and the Guardian Programmer's Guide.
770 Guardian Procedure Calls (L)