Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (s and S) SPT_UNLOCKREC(2)
NAME
SPT_UNLOCKREC - Unlocks a Guardian file record currently locked by the user
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <cextdecs.h>]
#include <spthread.h>
short SPT_UNLOCKREC (
short filenum,
[long tag ]
);
PARAMETERS
filenum specifies the Guardian file number of a Guardian file open instance for the file
containing the record you want unlocked.
tag is for nowait I/O only. The tag value you define uniquely identifies the operation
associated with this call.
This parameter is supported only for program compatibility; if you provide it, it
is ignored.
DESCRIPTION
The SPT_UNLOCKREC() function is the thread-aware version of the Guardian UNLOCKREC
procedure.
The SPT_UNLOCKREC() function unlocks a record in the specified file currently locked by
the user. The user is defined either as the opener of the file (identified by the filenum value used)
if the file is not audited, or by the transaction (identified by the TRANSID) if the file is audited.
This call unlocks the record at the current position in the file, allowing other users to access that
record. This call has no affect on a record of an audited file if the current transaction has
modified that record.
For programming information about the Guardian UNLOCKREC file-system procedure, see the
Enscribe Programmer’s Guide and the Guardian Programmer’s Guide.
Considerations
File opened nowait and SPT_UNLOCKREC( )
The SPT_UNLOCKREC() function must complete with a corresponding call to
the Guardian AWAITIOX procedure when used with a file that is opened for
nowait I/O.
Locking queue 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, the user is granted the
lock (which excludes other process from accessing the record) and resumes pro-
cessing. If the user granted access is waiting to read the record, its read is pro-
cessed.
527186-023 Hewlett-Packard Company 7435