gtpc2m4i | C/C++ Language Support User's Guide |
This function is used to lock a resource from access by another I-stream. If the lock is held by this I-stream, a dump is taken and the lock updated to show this occurrence. If the lock is held by another I-stream, the code will spin for a second or return a condition code depending on the t_lock_opt value. If the spin ends successfully, a catastrophic dump is taken. If the lock is free, this code will lock it.
Format
#include <tpfapi.h> int lockc(void *lockword, enum t_lock_opt opt);
Normal Return
Zero.
Error Return
4 Lock is being held by another I-stream (for LOCK_O_RETN only)
Programming Considerations
Examples
The following example attempts to lock an area in which the lock field is pointed to by table_lock_ptr. The return condition is checked.
#include <tpfapi.h>
·
·
·
if (lockc(table_lock_ptr,LOCK_O_RETN)!=0)
·
·
·
Related Information