45.8. slapi_wait_condvar()

Description

This function waits on the condition variable until it receives notification; see the slapi_notify_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_wait_condvar( Slapi_CondVar *cvar, struct timeval *timeout );

Parameters

This function takes the following parameters:

cvar
Pointer to a Slapi_CondVar structure representing the condition variable on which you want to wait.
timeout
Time period to wait for notification on the condition variable. If NULL, the calling function blocks indefinitely.
Returns

This function returns one of the following values:

  • A non-zero value if successful.
  • 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.