45.4. slapi_new_condvar()

Description

This function creates a new condition variable and returns a pointer to the Slapi_CondVar structure. You can create the Slapi_Mutex structure by calling the slapi_new_mutex() function. See Slapi_CondVar

To wait on the condition variable, call the slapi_wait_condvar() function. To notify waiting threads, call the slapi_notify_condvar() function.
When you are done working with this Slapi_CondVar structure, call the slapi_destroy_condvar() function to free the structure from memory.
Syntax

#include "slapi-plugin.h"
Slapi_CondVar *slapi_new_condvar( Slapi_Mutex *mutex );

Parameters

This function takes the following parameters:

mutex
Pointer to a Slapi_Mutex structure representing the mutex that you want used to protect this condition variable.
Returns

This function returns one of the following values:

  • A pointer to the new Slapi_CondVar structure.
  • NULL if memory cannot be allocated.