reenable recursive resource_mutex
[nobug] / src / nobug_resources.c
index 72fdbe0..58c02f6 100644 (file)
@@ -95,7 +95,10 @@ void
 nobug_resource_init (void)
 {
 #if NOBUG_USE_PTHREAD
-  pthread_mutex_init (&nobug_resource_mutex, NULL);
+  static pthread_mutexattr_t attr;
+  pthread_mutexattr_init (&attr);
+  pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
+  pthread_mutex_init (&nobug_resource_mutex, &attr);
 #endif
 
   llist_init (&nobug_resource_registry);