libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
OgcThreadDriver.h
1/****************************************************************************
2 * Platform Abstraction Layer (OGC driver)
3 * Daryl Borth 2026
4 * OgcThreadDriver.h
5 ***************************************************************************/
6#pragma once
7#include "../ThreadDriver.h"
8
12{
13 public:
14 void init() override;
15 void shutdown() override;
16
17 bool createThread(ThreadEntry entry, void * arg, uint32_t stackSize, ThreadPriority priority, void ** outHandle) override;
18 void joinThread(void * thread) override;
19 void cancelThread(void * thread) override;
20 void suspendThread(void * thread) override;
21 void resumeThread(void * thread) override;
22 bool isThreadSuspended(void * thread) override;
23
24 void * createMutex() override;
25 void destroyMutex(void * mutex) override;
26 void lockMutex(void * mutex) override;
27 void unlockMutex(void * mutex) override;
28
29 void * createCond() override;
30 void destroyCond(void * cond) override;
31 void waitCond(void * cond, void * mutex) override;
32 void signalCond(void * cond) override;
33
34 void sleepMilliseconds(uint32_t ms) override;
35
36 uintptr_t getCurrentThreadId() override;
37};
GC/Wii ThreadDriver, built on libogc's LWP threading primitives.
void shutdown() override
Shuts the threading backend down. Every thread must already have been joined.
void * createCond() override
Creates a condition variable.
bool isThreadSuspended(void *thread) override
void unlockMutex(void *mutex) override
Releases a mutex held by the calling thread.
void signalCond(void *cond) override
Wakes every thread currently blocked in waitCond() on this condition variable.
bool createThread(ThreadEntry entry, void *arg, uint32_t stackSize, ThreadPriority priority, void **outHandle) override
Creates and starts a thread running entry(arg).
void * createMutex() override
Creates an unlocked mutex.
void joinThread(void *thread) override
Blocks until the thread exits, then releases the handle.
void suspendThread(void *thread) override
Suspends a running thread until resumeThread() is called.
void sleepMilliseconds(uint32_t ms) override
Sleeps the calling thread for at least the given duration.
uintptr_t getCurrentThreadId() override
Returns an opaque, comparable identifier for the calling thread.
void resumeThread(void *thread) override
Resumes a thread suspended with suspendThread().
void lockMutex(void *mutex) override
Blocks until the mutex is acquired.
void init() override
Initializes the threading backend.
void waitCond(void *cond, void *mutex) override
Atomically unlocks mutex and blocks the calling thread until signalCond() is called,...
void cancelThread(void *thread) override
Requests the thread stop running and releases the handle without blocking on it.
void destroyMutex(void *mutex) override
Destroys a mutex created by createMutex(). It must not be locked.
void destroyCond(void *cond) override
Destroys a condition variable created by createCond(). No thread may be waiting on it.
Raw platform threading primitives.
ThreadPriority
Abstract thread priority, mapped to each platform's native priority scheme.
Definition Thread.h:18