Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (n - p) PUT_UNLOCKREC(2)
• Include the pthread.h header file in the application.
• Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
• Compile the application using the -Wlp64 compiler command option.
• Link the application to the yputdll library (/G/system/zdllnnn/yputdll).
Considerations
File opened nowait and PUT_UNLOCKREC( )
The PUT_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.
Calling PUT_UNLOCKREC( ) after KEYPOSITION
If the call to PUT_UNLOCKREC( ) immediately follows a call to KEYPOSI-
TION where a nonunique alternate key is specified, the PUT_UNLOCKREC( )
call fails. A subsequent call to FILE_GETINFO_ or FILEINFO shows that
Guardian file-system error 46 (invalid key) occurred. However, if an inter-
mediate call to PUT_READX( ) or PUT_READLOCKX() is performed, the
call to PUT_UNLOCKREC( ) is permitted.
Unlocking several records
If several records need to be unlocked, you can call the PUT_UNLOCKREC()
function to unlock all records currently locked by the user (rather than unlocking
the records through individual calls to PUT_UNLOCKREC( )).
Current-state indicators after PUT_UNLOCKREC( )
For key-sequenced, relative, and entry-sequenced files, the current-state indica-
tors after an UNLOCKREC remain unchanged.
File pointers after PUT_UNLOCKREC( )
For unstructured files, the current-record pointer and the next-record pointer
remain unchanged.
Transaction Management Facility (TMF) and PUT_UNLOCKREC()
If the current transaction modifies a record in file audited by TMF, locks on the
record are released only when TMF ends or aborts the transaction. In other
words, a locked record in an audited file that the current transaction modified is
unlocked during PUT_ENDTRANSACTION() or
PUT_ABORTTRANSACTION() processing for that file. You can use the
PUT_UNLOCKREC( ) function to unlock an unmodified audited record.
527186-023 Hewlett-Packard Company 5−289