17typedef void* (*ThreadEntry)(
void* arg);
80 virtual void waitCond(
void * cond,
void * mutex) = 0;
Raw platform threading primitives.
virtual void * createMutex()=0
Creates an unlocked mutex.
virtual void unlockMutex(void *mutex)=0
Releases a mutex held by the calling thread.
virtual void shutdown()=0
Shuts the threading backend down. Every thread must already have been joined.
virtual void sleepMilliseconds(uint32_t ms)=0
Sleeps the calling thread for at least the given duration.
virtual void init()=0
Initializes the threading backend.
virtual void waitCond(void *cond, void *mutex)=0
Atomically unlocks mutex and blocks the calling thread until signalCond() is called,...
virtual void signalCond(void *cond)=0
Wakes every thread currently blocked in waitCond() on this condition variable.
virtual void resumeThread(void *thread)=0
Resumes a thread suspended with suspendThread().
virtual void cancelThread(void *thread)=0
Requests the thread stop running and releases the handle without blocking on it.
virtual void destroyCond(void *cond)=0
Destroys a condition variable created by createCond(). No thread may be waiting on it.
virtual bool isThreadSuspended(void *thread)=0
virtual uintptr_t getCurrentThreadId()=0
Returns an opaque, comparable identifier for the calling thread.
virtual void * createCond()=0
Creates a condition variable.
virtual void joinThread(void *thread)=0
Blocks until the thread exits, then releases the handle.
virtual bool createThread(ThreadEntry entry, void *arg, uint32_t stackSize, ThreadPriority priority, void **outHandle)=0
Creates and starts a thread running entry(arg).
virtual void suspendThread(void *thread)=0
Suspends a running thread until resumeThread() is called.
virtual void destroyMutex(void *mutex)=0
Destroys a mutex created by createMutex(). It must not be locked.
virtual void lockMutex(void *mutex)=0
Blocks until the mutex is acquired.
ThreadPriority
Abstract thread priority, mapped to each platform's native priority scheme.