40 printf (
"mutex locked section 1\n");
45 printf (
"mutex locked section 2\n");
52 TEST (mutexforgotunlock)
66 TEST (mutexexplicitunlock)
73 ECHO(
"mutex locked section");
74 LUMIERA_MUTEX_SECTION_UNLOCK;
82 TEST (nestedmutexsection)
92 printf (
"outer mutex locked section\n");
96 printf (
"inner mutex locked section\n");
104 TEST (chainedmutexsection)
114 printf (
"outer mutex locked section\n");
118 printf (
"inner but not outer mutex locked section\n");
128 TEST (recursivemutexsection)
136 printf (
"recmutex locked once\n");
140 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.