lib/mutex.c File Reference


Detailed Description

Mutual exclusion locking.

Definition in file mutex.c.

#include "lib/mutex.h"

Include dependency graph for mutex.c:

Go to the source code of this file.

Functions

 LUMIERA_ERROR_DEFINE (MUTEX_DESTROY,"Mutex destroy failed")
 LUMIERA_ERROR_DEFINE (MUTEX_UNLOCK,"Mutex unlocking failed")
 LUMIERA_ERROR_DEFINE (MUTEX_LOCK,"Mutex locking failed")
LumieraMutex lumiera_mutex_destroy (LumieraMutex self, struct nobug_flag *flag)
 Destroy a mutex variable.
LumieraMutex lumiera_mutex_init (LumieraMutex self, const char *purpose, struct nobug_flag *flag)
 Initialize a mutex variable This initializes a 'fast' default mutex which must not be locked recursively from one thread.
LumieraMutex lumiera_recmutex_init (LumieraMutex self, const char *purpose, struct nobug_flag *flag)
 Initialize a mutex variable Initializes a 'recursive' mutex which might be locked by the same thread multiple times.
static void recursive_mutexattr_init ()

Variables

static pthread_mutexattr_t recursive_mutexattr
static pthread_once_t recursive_mutexattr_once = PTHREAD_ONCE_INIT


Function Documentation

LumieraMutex lumiera_mutex_init ( LumieraMutex  self,
const char *  purpose,
struct nobug_flag *  flag 
)

Initialize a mutex variable This initializes a 'fast' default mutex which must not be locked recursively from one thread.

Parameters:
self is a pointer to the mutex to be initialized
Returns:
self as given

Definition at line 35 of file mutex.c.

Referenced by lumiera_config_init(), lumiera_filedescriptor_new(), lumiera_filedescriptor_registry_init(), lumiera_filehandlecache_new(), lumiera_mmapcache_new(), and lumiera_mmapings_init().

Here is the caller graph for this function:

LumieraMutex lumiera_recmutex_init ( LumieraMutex  self,
const char *  purpose,
struct nobug_flag *  flag 
)

Initialize a mutex variable Initializes a 'recursive' mutex which might be locked by the same thread multiple times.

Parameters:
self is a pointer to the mutex to be initialized
Returns:
self as given

Definition at line 58 of file mutex.c.

Referenced by lumiera_interfaceregistry_init().

Here is the caller graph for this function:

LumieraMutex lumiera_mutex_destroy ( LumieraMutex  self,
struct nobug_flag *  flag 
)

Destroy a mutex variable.

Parameters:
self is a pointer to the mutex to be destroyed
Returns:
self as given

Definition at line 74 of file mutex.c.

References LUMIERA_DIE.

Referenced by lumiera_config_destroy(), lumiera_filedescriptor_delete(), lumiera_filedescriptor_registry_destroy(), lumiera_filehandlecache_delete(), lumiera_mmapcache_delete(), and lumiera_mmapings_destroy().

Here is the caller graph for this function:


Generated on Tue Jan 6 17:20:49 2009 for Lumiera by  doxygen 1.5.6