HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
45 Functions for managing locks and synchronization
This chapter contains reference information on locks and synchronization routines.
Table 45-1 Locks and synchronization routines
DescriptionFunction
Frees a Slapi_CondVar structure from memory.“slapi_destroy_condvar()”
Frees a Slapi_Mutex structure from memory.“slapi_destroy_mutex()”
Locks the specified mutex.“slapi_lock_mutex()”
Creates a new condition variable and returns a pointer to the corresponding
Slapi_CondVar structure.
“slapi_new_condvar()”
Creates a new mutex and returns a pointer to the corresponding Slapi_Mutex
structure.
“slapi_new_mutex()”
Notifies a thread that is waiting on the specified condition variable.“slapi_notify_condvar()”
Unlocks the specified mutex.“slapi_unlock_mutex()”
Waits on a condition variable.Chapter 45 “Functions for managing
locks and synchronization”
45.1 slapi_destroy_condvar()
This function frees a Slapi_CondVer structure from memory. Before calling this function, you
should make sure that this condition variable is no longer in use. See Slapi_CondVar.
Syntax
#include "slapi-plugin.h"
void slapi_destroy_condvar( Slapi_CondVar *cvar );
Parameters This function takes the following parameters:
Pointer to the Slapi_CondVar structure that you want to free from memory.
cvar
45.2 slapi_destroy_mutex()
Description This function frees a Slapi_Mutex structure from memory. The calling function
must ensure that no thread is currently in a lock-specific function. Locks do not provide
self-referential protection against deletion. See Slapi_Mutex.
Syntax
#include "slapi-plugin.h"
void slapi_destroy_mutex( Slapi_Mutex *mutex );
Parameters This function takes the following parameters:
Pointer to the Slapi_Mutex structure that you want to free from memory.mutex
45.3 slapi_lock_mutex()
Description This function locks the mutex specified by the Slapi_Mutex structure. After this
function returns, any other thread that attempts to acquire the same lock is blocked until the
holder of the lock releases the lock. Acquiring the lock is not an interruptible operation, nor is
there any time-out mechanism.
Syntax
45.1 slapi_destroy_condvar() 359