Foundations

This commit is contained in:
2026-08-29 01:50:50 +08:00
parent bf5fc3bda6
commit 8e95904cc4
100 changed files with 13997 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
#ifndef INCLUDED_C_COND_H
#define INCLUDED_C_COND_H
#ifndef INCLUDED_C_MUTEX_H
#include <c_Mutex.h>
#endif /*INCLUDED_C_MUTEX_H*/
/* ------------------------------------------------------------------------------------------------------------------ */
/* */
typedef struct {
#if defined(PLATFORM_WINDOWS)
CONDITION_VARIABLE handle;
#elif defined(PLATFORM_POSIX)
pthread_cond_t handle;
#endif
c_bool_t is_initialized;
} c_Cond_t;
/* ------------------------------------------------------------------------------------------------------------------ */
/* */
c_err_t c_Cond_Init(c_Cond_t* cond);
void c_Cond_Destroy(c_Cond_t* cond);
void c_Cond_Wait(c_Cond_t* cond, c_Mutex_t* mutex);
c_bool_t c_Cond_TimedWait(c_Cond_t* cond, c_Mutex_t* mutex, c_uint_t timeout_ms);
void c_Cond_Signal(c_Cond_t* cond);
void c_Cond_Broadcast(c_Cond_t* cond);
#endif /*INCLUDED_C_COND_H*/