33 lines
1015 B
C
33 lines
1015 B
C
f64 GetUnixTimestamp ();
|
|
s64 GetUnixTimestampNanoseconds ();
|
|
|
|
struct Condition_Variable;
|
|
struct Semaphore;
|
|
struct Mutex;
|
|
struct OS_Thread;
|
|
|
|
enum class Wait_For_Result : s32 {
|
|
SUCCESS = 0,
|
|
TIMEOUT = 1,
|
|
ERROR = 2 // can't use ERROR because of Windows.h *sigh*
|
|
};
|
|
|
|
internal void mutex_init (Mutex* mutex);
|
|
internal void mutex_destroy (Mutex* mutex);
|
|
internal void lock (Mutex* mutex);
|
|
internal void unlock (Mutex* mutex);
|
|
|
|
internal void semaphore_init (Semaphore* sem, s32 initial_value = 0);
|
|
internal void semaphore_destroy (Semaphore* sem);
|
|
internal void signal (Semaphore* sem);
|
|
internal Wait_For_Result wait_for (Semaphore* sem, s32 milliseconds = -1);
|
|
|
|
internal void condition_variable_init (Condition_Variable* cv);
|
|
internal void condition_variable_destroy (Condition_Variable* cv);
|
|
internal void wait (Condition_Variable* cv, Mutex* mutex, s32 wait_time_ms = -1);
|
|
internal void wake (Condition_Variable* cv);
|
|
internal void wake_all (Condition_Variable* cv);
|
|
|
|
// #window_creation
|
|
typedef HWND Window_Type;
|