103#define STATIC_MUTEX_INIT {{0}, 0}
104#define STATIC_RWLOCK_INIT {{0}, 0}
105#define STATIC_COND_INIT {{0}, 0}
107#define STATIC_MUTEX_INIT {PTHREAD_MUTEX_INITIALIZER, 1}
108#define STATIC_RWLOCK_INIT {PTHREAD_RWLOCK_INITIALIZER, 1}
109#define STATIC_COND_INIT {PTHREAD_COND_INITIALIZER, 1}
119 LONG prev = InterlockedCompareExchange(&m->
initialized, 1, 0);
126 }
else if (prev == 1) {
128 while (InterlockedCompareExchange(&m->
initialized, 2, 2) != 2) {
143 LONG prev = InterlockedCompareExchange(&l->
initialized, 1, 0);
148 }
else if (prev == 1) {
149 while (InterlockedCompareExchange(&l->
initialized, 2, 2) != 2) {
159 LONG prev = InterlockedCompareExchange(&l->
initialized, 1, 0);
164 }
else if (prev == 1) {
165 while (InterlockedCompareExchange(&l->
initialized, 2, 2) != 2) {
175 LONG prev = InterlockedCompareExchange(&c->
initialized, 1, 0);
180 }
else if (prev == 1) {
181 while (InterlockedCompareExchange(&c->
initialized, 2, 2) != 2) {
185 if (InterlockedCompareExchange(&m->
initialized, 1, 0) == 0) {
194 LONG prev = InterlockedCompareExchange(&c->
initialized, 1, 0);
199 }
else if (prev == 1) {
200 while (InterlockedCompareExchange(&c->
initialized, 2, 2) != 2) {
204 if (InterlockedCompareExchange(&m->
initialized, 1, 0) == 0) {
213 LONG prev = InterlockedCompareExchange(&c->
initialized, 1, 0);
218 }
else if (prev == 1) {
219 while (InterlockedCompareExchange(&c->
initialized, 2, 2) != 2) {
229 LONG prev = InterlockedCompareExchange(&c->
initialized, 1, 0);
234 }
else if (prev == 1) {
235 while (InterlockedCompareExchange(&c->
initialized, 2, 2) != 2) {
🔌 Cross-platform abstraction layer umbrella header for ascii-chat
asciichat_error_t
Error and exit codes - unified status values (0-255)
Static condition variable structure for global condition variables requiring static initialization.
volatile int initialized
Thread-safe initialization flag (POSIX: int for atomic operations)
cond_t cond
The actual condition variable.
Static mutex structure for global mutexes requiring static initialization.
volatile int initialized
Thread-safe initialization flag (POSIX: int for atomic operations)
mutex_t mutex
The actual mutex.
Static reader-writer lock structure for global rwlocks requiring static initialization.
rwlock_t lock
The actual reader-writer lock.
volatile int initialized
Thread-safe initialization flag (POSIX: int for atomic operations)