libkernaux/include/kernaux/generic/mutex.h

26 lines
537 B
C
Raw Normal View History

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