2022-06-18 06:14:17 -04:00
|
|
|
#ifndef KERNAUX_INCLUDED_MUTEX
|
|
|
|
#define KERNAUX_INCLUDED_MUTEX
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-06-20 17:28:35 -04:00
|
|
|
#include <kernaux/macro.h>
|
2022-06-18 06:14:17 -04:00
|
|
|
|
2022-06-20 17:28:35 -04:00
|
|
|
typedef void (*KernAux_Mutex_Lock )(void *mutex);
|
|
|
|
typedef void (*KernAux_Mutex_Unlock)(void *mutex);
|
2022-06-18 06:14:17 -04:00
|
|
|
|
2022-06-25 11:43:18 -04:00
|
|
|
typedef const struct KernAux_Mutex {
|
2022-06-20 17:28:35 -04:00
|
|
|
KernAux_Mutex_Lock KERNAUX_PROTECTED_FIELD(lock);
|
|
|
|
KernAux_Mutex_Unlock KERNAUX_PROTECTED_FIELD(unlock);
|
2022-06-18 06:14:17 -04:00
|
|
|
} *KernAux_Mutex;
|
|
|
|
|
|
|
|
void KernAux_Mutex_lock (KernAux_Mutex mutex);
|
|
|
|
void KernAux_Mutex_unlock(KernAux_Mutex mutex);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|