45.5. slapi_new_mutex()

Description

This function creates a new mutex and returns a pointer to the Slapi_Mutex structure. You can lock this mutex by calling the slapi_lock_mutex() function and unlock the mutex by calling the slapi_unlock_mutex() function. See Slapi_Mutex

When you are done working with the mutex, you can free the Slapi_Mutex structure by calling the slapi_destroy_mutex() function.
Syntax

#include "slapi-plugin.h"
Slapi_Mutex *slapi_new_mutex();

Returns

This function returns one of the following values:

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