Files
CgeThread/posix/Internal.h
Mikhail Romanko 04e02490b7
Some checks failed
CI / build-and-analyze (push) Failing after 1m18s
Initial commit
2026-08-09 12:55:16 +03:00

41 lines
620 B
C

#ifndef CGE_THREAD_INTERNAL_H
#define CGE_THREAD_INTERNAL_H
#define _POSIX_C_SOURCE 200112L
#include "../CgeThread.h"
#include <unistd.h>
#include <pthread.h>
struct CgeCondition {
pthread_cond_t handle;
};
struct CgeMutex {
pthread_mutex_t handle;
};
#if (_POSIX_SEMAPHORES >= 200112L)
#include <semaphore.h>
struct CgeSemaphore {
sem_t handle;
};
#else
struct CgeSemaphore {
int count;
int waiters;
pthread_mutex_t mutex;
pthread_cond_t condition;
};
#endif
struct CgeThread {
pthread_t handle;
};
struct CgeTss {
pthread_key_t handle;
};
#endif /* CGE_THREAD_INTERNAL_H */