To view the latest 11.3.x version, see PATROL Agent 11.3.02.

destroy_lock()


Destroy a PSL process lock and wake all processes blocked on the lock.

Syntax

destroy_lock(lockname)

Parameters

Parameter

Definition

lockname

name of the lock that is destroyed

Description

The destroy_lock( ) function destroys lockname that was previously granted to a PSL process and wakes all processes that are blocked on it. (Processes become blocked on a lock through either the lock() or cond_wait() function calls.) The destroy_lock() function returns 1 if it successfully finds and destroys lockname, and 0 if it does not.

The lock() and cond_wait() functions set the PSL variable errno = 114 (E_PSL_LOCK_DESTROYED) if the lock upon which they are blocked is destroyed.

Example

The following example creates the lock PASSWD_FILE_LOCK and then destroys the lock using the destroy_lock() function:

if (lock("PASSWD_FILE_LOCK","w",180))
{
print("Got the lock\n");
}
else
{
print("Did not get it\n");
}
status = destroy_lock("PASSWD_FILE_LOCK");
if (status != 1)
{
print("Failed to destroy the lock\n");
}
else
{
print ("Destroyed the lock\n");
}

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*