49 printf (
"mutex locked section 1\n");
54 printf (
"mutex locked section 2\n");
61 TEST (mutexforgotunlock)
75 TEST (mutexexplicitunlock)
82 ECHO(
"mutex locked section");
83 LUMIERA_MUTEX_SECTION_UNLOCK;
91 TEST (nestedmutexsection)
101 printf (
"outer mutex locked section\n");
105 printf (
"inner mutex locked section\n");
113 TEST (chainedmutexsection)
123 printf (
"outer mutex locked section\n");
127 printf (
"inner but not outer mutex locked section\n");
137 TEST (recursivemutexsection)
145 printf (
"recmutex locked once\n");
149 printf (
"recmutex locked twice\n");
#define LUMIERA_RECMUTEX_SECTION(nobugflag, mtx)
Recursive Mutual exclusive section.
LumieraRecmutex lumiera_recmutex_destroy(LumieraRecmutex self, struct nobug_flag *flag, const struct nobug_context ctx)
Destroy a recursive mutex variable.
Helpers and support macros for defining test executables in C.
#define LUMIERA_MUTEX_SECTION(nobugflag, mtx)
Mutual exclusive section.
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...
Mutual exclusion locking, header.
#define LUMIERA_MUTEX_SECTION_CHAIN(nobugflag, mtx)
Mutual exclusion chainbuilder section.
LumieraMutex lumiera_mutex_init(LumieraMutex self, const char *purpose, struct nobug_flag *flag, const struct nobug_context ctx)
Initialise a mutex variable This initialises a 'fast' default mutex which must not be locked recursiv...
LumieraMutex lumiera_mutex_destroy(LumieraMutex self, struct nobug_flag *flag, const struct nobug_context ctx)
Destroy a mutex variable.