This commit is contained in:
40
posix/Internal.h
Normal file
40
posix/Internal.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#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 */
|
||||
Reference in New Issue
Block a user