21 static pthread_once_t recmutexattr_once = PTHREAD_ONCE_INIT;
22 static pthread_mutexattr_t recmutexattr;
24 static void recmutexattr_init()
26 pthread_mutexattr_init (&recmutexattr);
27 pthread_mutexattr_settype (&recmutexattr, PTHREAD_MUTEX_RECURSIVE);
34 struct nobug_flag* flag,
35 const struct nobug_context ctx)
39 pthread_once (&recmutexattr_once, recmutexattr_init);
41 NOBUG_RESOURCE_HANDLE_INIT (self->rh);
42 NOBUG_RESOURCE_ANNOUNCE_RAW_CTX (flag,
"recmutex", purpose,
self, self->rh, ctx)
44 pthread_mutex_init (&self->recmutex, &recmutexattr);
54 struct nobug_flag* flag,
55 const struct nobug_context ctx)
59 NOBUG_RESOURCE_FORGET_RAW_CTX (flag, self->rh, ctx)
61 if (pthread_mutex_destroy (&self->recmutex))
LumieraRecmutex lumiera_recmutex_destroy(LumieraRecmutex self, struct nobug_flag *flag, const struct nobug_context ctx)
Destroy a recursive mutex variable.
Mutual exclusion locking, header.
LumieraRecmutex lumiera_recmutex_init(LumieraRecmutex self, const char *purpose, struct nobug_flag *flag, const struct nobug_context ctx)
Initialise a recursive mutex variable Initialises a 'recursive' mutex which might be locked by the sa...
#define LUMIERA_DIE(err)
Abort unconditionally with a 'Fatal Error!' message.