ciabatta/include/cia/sync.h

19 lines
371 B
C
Raw Normal View History

2023-08-26 11:35:18 +00:00
#pragma once
2023-08-27 02:51:35 +00:00
#include <stdatomic.h>
2023-08-26 11:35:18 +00:00
2023-08-27 02:51:35 +00:00
int cia_wait(u32 *addr, u32 compare_with, u64 time);
int cia_wake_one(u32 *addr, u32 *n_woken);
int cia_wake_all(u32 *addr, u32 *n_woken);
struct Cia_Mutex typedef Cia_Mutex;
struct Cia_Mutex {
u32 tag;
};
void cia_mutex_init(Cia_Mutex *mutex);
void cia_mutex_lock(Cia_Mutex *mutex);
void cia_mutex_unlock(Cia_Mutex *mutex);