45.6. slapi_notify_condvar()

Description

This function notifies one or all threads that are waiting on the condition variable (see the slapi_wait_condvar() function). Before calling this function, the calling thread must lock the mutex associated with this condition variable.

Syntax

#include "slapi-plugin.h"
int slapi_notify_condvar( Slapi_CondVar *cvar, int notify_all );

Parameters

This function takes the following parameters:

cvar
Pointer to an Slapi_CondVar structure representing the condition variable.
notify_all
If 1, notifies all threads that are waiting on the condition variable.
Returns

This function returns one of the following values:

  • A non-zero value if the thread (or threads) are successfully notified.
  • 0 if an error occurs; for example, if the condition variable is NULL or if the mutex associated with the condition variable is not locked.