Reorganize the folder structure and delete the Xcode build files
This commit is contained in:
parent
b7c7c98c45
commit
48a5d63045
39 changed files with 0 additions and 484 deletions
52
src/PlatformThreads.h
Executable file
52
src/PlatformThreads.h
Executable file
|
|
@ -0,0 +1,52 @@
|
|||
#pragma once
|
||||
|
||||
#include "Limelight.h"
|
||||
#include "Platform.h"
|
||||
|
||||
typedef void(*ThreadEntry)(void* context);
|
||||
|
||||
#if defined(LC_WINDOWS)
|
||||
typedef HANDLE PLT_MUTEX;
|
||||
typedef HANDLE PLT_EVENT;
|
||||
typedef struct _PLT_THREAD {
|
||||
HANDLE handle;
|
||||
int cancelled;
|
||||
} PLT_THREAD;
|
||||
#elif defined (LC_POSIX)
|
||||
typedef pthread_mutex_t PLT_MUTEX;
|
||||
typedef struct _PLT_EVENT {
|
||||
pthread_mutex_t mutex;
|
||||
pthread_cond_t cond;
|
||||
int signalled;
|
||||
} PLT_EVENT;
|
||||
typedef struct _PLT_THREAD {
|
||||
pthread_t thread;
|
||||
int cancelled;
|
||||
} PLT_THREAD;
|
||||
#else
|
||||
#error Unsupported platform
|
||||
#endif
|
||||
|
||||
int PltCreateMutex(PLT_MUTEX* mutex);
|
||||
void PltDeleteMutex(PLT_MUTEX* mutex);
|
||||
void PltLockMutex(PLT_MUTEX* mutex);
|
||||
void PltUnlockMutex(PLT_MUTEX* mutex);
|
||||
|
||||
int PltCreateThread(ThreadEntry entry, void* context, PLT_THREAD*thread);
|
||||
void PltCloseThread(PLT_THREAD*thread);
|
||||
void PltInterruptThread(PLT_THREAD*thread);
|
||||
int PltIsThreadInterrupted(PLT_THREAD*thread);
|
||||
void PltJoinThread(PLT_THREAD*thread);
|
||||
|
||||
int PltCreateEvent(PLT_EVENT* event);
|
||||
void PltCloseEvent(PLT_EVENT* event);
|
||||
void PltSetEvent(PLT_EVENT* event);
|
||||
void PltClearEvent(PLT_EVENT* event);
|
||||
int PltWaitForEvent(PLT_EVENT* event);
|
||||
|
||||
void PltRunThreadProc(void);
|
||||
|
||||
#define PLT_WAIT_SUCCESS 0
|
||||
#define PLT_WAIT_INTERRUPTED 1
|
||||
|
||||
void PltSleepMs(int ms);
|
||||
Loading…
Add table
Add a link
Reference in a new issue