30 static pthread_once_t recmutexattr_once = PTHREAD_ONCE_INIT;
31 static pthread_mutexattr_t recmutexattr;
33 static void recmutexattr_init()
35 pthread_mutexattr_init (&recmutexattr);
36 pthread_mutexattr_settype (&recmutexattr, PTHREAD_MUTEX_RECURSIVE);
43 struct nobug_flag* flag,
44 const struct nobug_context ctx)
48 pthread_once (&recmutexattr_once, recmutexattr_init);
50 NOBUG_RESOURCE_HANDLE_INIT (self->rh);
51 NOBUG_RESOURCE_ANNOUNCE_RAW_CTX (flag,
"recmutex", purpose,
self, self->rh, ctx)
53 pthread_mutex_init (&self->recmutex, &recmutexattr);
63 struct nobug_flag* flag,
64 const struct nobug_context ctx)
68 NOBUG_RESOURCE_FORGET_RAW_CTX (flag, self->rh, ctx)
70 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.