RetroArch
Classes | Macros | Typedefs | Enumerations | Functions
thread.h File Reference
#include <wiiu/types.h>
#include "time.h"
Include dependency graph for thread.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  OSContext
 
struct  OSMutexQueue
 
struct  OSFastMutexQueue
 
struct  OSThreadLink
 
struct  OSThreadQueue
 
struct  OSThreadSimpleQueue
 
struct  OSThread
 

Macros

#define OS_CONTEXT_TAG   0x4F53436F6E747874ull
 
#define OS_THREAD_TAG   0x74487244u
 

Typedefs

typedef struct OSThread OSThread
 
typedef int(* OSThreadEntryPointFn) (int argc, const char **argv)
 
typedef void(* OSThreadCleanupCallbackFn) (OSThread *thread, void *stack)
 
typedef void(* OSThreadDeallocatorFn) (OSThread *thread, void *stack)
 
typedef uint8_t OSThreadState
 
typedef uint32_t OSThreadRequest
 
typedef uint8_t OSThreadAttributes
 
typedef struct OSContext OSContext
 
typedef struct OSMutex OSMutex
 
typedef struct OSFastMutex OSFastMutex
 
typedef struct OSMutexQueue OSMutexQueue
 
typedef struct OSFastMutexQueue OSFastMutexQueue
 

Enumerations

enum  OS_THREAD_STATE {
  OS_THREAD_STATE_NONE = 0, OS_THREAD_STATE_READY = 1 << 0, OS_THREAD_STATE_RUNNING = 1 << 1, OS_THREAD_STATE_WAITING = 1 << 2,
  OS_THREAD_STATE_MORIBUND = 1 << 3
}
 
enum  OS_THREAD_REQUEST { OS_THREAD_REQUEST_NONE = 0, OS_THREAD_REQUEST_SUSPEND = 1, OS_THREAD_REQUEST_CANCEL = 2 }
 
enum  OS_THREAD_ATTRIB {
  OS_THREAD_ATTRIB_AFFINITY_CPU0 = 1 << 0, OS_THREAD_ATTRIB_AFFINITY_CPU1 = 1 << 1, OS_THREAD_ATTRIB_AFFINITY_CPU2 = 1 << 2, OS_THREAD_ATTRIB_AFFINITY_ANY = ((1 << 0) | (1 << 1) | (1 << 2)),
  OS_THREAD_ATTRIB_DETACHED = 1 << 3, OS_THREAD_ATTRIB_STACK_USAGE = 1 << 5
}
 

Functions

void OSCancelThread (OSThread *thread)
 
int32_t OSCheckActiveThreads ()
 
int32_t OSCheckThreadStackUsage (OSThread *thread)
 
void OSClearThreadStackUsage (OSThread *thread)
 
void OSContinueThread (OSThread *thread)
 
BOOL OSCreateThread (OSThread *thread, OSThreadEntryPointFn entry, int32_t argc, char *argv, void *stack, uint32_t stackSize, int32_t priority, OSThreadAttributes attributes)
 
void OSDetachThread (OSThread *thread)
 
void OSExitThread (int32_t result)
 
void OSGetActiveThreadLink (OSThread *thread, OSThreadLink *link)
 
OSThreadOSGetCurrentThread ()
 
OSThreadOSGetDefaultThread (uint32_t coreID)
 
uint32_t OSGetStackPointer ()
 
uint32_t OSGetThreadAffinity (OSThread *thread)
 
const char * OSGetThreadName (OSThread *thread)
 
int32_t OSGetThreadPriority (OSThread *thread)
 
uint32_t OSGetThreadSpecific (uint32_t id)
 
BOOL OSIsThreadSuspended (OSThread *thread)
 
BOOL OSIsThreadTerminated (OSThread *thread)
 
BOOL OSJoinThread (OSThread *thread, int *threadResult)
 
int32_t OSResumeThread (OSThread *thread)
 
BOOL OSRunThread (OSThread *thread, OSThreadEntryPointFn entry, int argc, const char **argv)
 
BOOL OSSetThreadAffinity (OSThread *thread, uint32_t affinity)
 
BOOL OSSetThreadCancelState (BOOL state)
 
OSThreadCleanupCallbackFn OSSetThreadCleanupCallback (OSThread *thread, OSThreadCleanupCallbackFn callback)
 
OSThreadDeallocatorFn OSSetThreadDeallocator (OSThread *thread, OSThreadDeallocatorFn deallocator)
 
void OSSetThreadName (OSThread *thread, const char *name)
 
BOOL OSSetThreadPriority (OSThread *thread, int32_t priority)
 
BOOL OSSetThreadRunQuantum (OSThread *thread, uint32_t quantum)
 
void OSSetThreadSpecific (uint32_t id, uint32_t value)
 
BOOL OSSetThreadStackUsage (OSThread *thread)
 
void OSSleepThread (OSThreadQueue *queue)
 
void OSSleepTicks (OSTime ticks)
 
uint32_t OSSuspendThread (OSThread *thread)
 
void OSTestThreadCancel ()
 
void OSWakeupThread (OSThreadQueue *queue)
 
void OSYieldThread ()
 
void OSInitThreadQueue (OSThreadQueue *queue)
 
void OSInitThreadQueueEx (OSThreadQueue *queue, void *parent)
 

Macro Definition Documentation

◆ OS_CONTEXT_TAG

#define OS_CONTEXT_TAG   0x4F53436F6E747874ull

◆ OS_THREAD_TAG

#define OS_THREAD_TAG   0x74487244u

Typedef Documentation

◆ OSContext

typedef struct OSContext OSContext

◆ OSFastMutex

typedef struct OSFastMutex OSFastMutex

◆ OSFastMutexQueue

◆ OSMutex

typedef struct OSMutex OSMutex

◆ OSMutexQueue

typedef struct OSMutexQueue OSMutexQueue

◆ OSThread

typedef struct OSThread OSThread

◆ OSThreadAttributes

◆ OSThreadCleanupCallbackFn

typedef void(* OSThreadCleanupCallbackFn) (OSThread *thread, void *stack)

◆ OSThreadDeallocatorFn

typedef void(* OSThreadDeallocatorFn) (OSThread *thread, void *stack)

◆ OSThreadEntryPointFn

typedef int(* OSThreadEntryPointFn) (int argc, const char **argv)

◆ OSThreadRequest

◆ OSThreadState

Enumeration Type Documentation

◆ OS_THREAD_ATTRIB

Enumerator
OS_THREAD_ATTRIB_AFFINITY_CPU0 

Allow the thread to run on CPU0.

OS_THREAD_ATTRIB_AFFINITY_CPU1 

Allow the thread to run on CPU1.

OS_THREAD_ATTRIB_AFFINITY_CPU2 

Allow the thread to run on CPU2.

OS_THREAD_ATTRIB_AFFINITY_ANY 

Allow the thread to run any CPU.

OS_THREAD_ATTRIB_DETACHED 

Start the thread detached.

OS_THREAD_ATTRIB_STACK_USAGE 

Enables tracking of stack usage.

◆ OS_THREAD_REQUEST

Enumerator
OS_THREAD_REQUEST_NONE 
OS_THREAD_REQUEST_SUSPEND 
OS_THREAD_REQUEST_CANCEL 

◆ OS_THREAD_STATE

Enumerator
OS_THREAD_STATE_NONE 
OS_THREAD_STATE_READY 

Thread is ready to run

OS_THREAD_STATE_RUNNING 

Thread is running

OS_THREAD_STATE_WAITING 

Thread is waiting, i.e. on a mutex

OS_THREAD_STATE_MORIBUND 

Thread is about to terminate

Function Documentation

◆ OSCancelThread()

void OSCancelThread ( OSThread thread)

◆ OSCheckActiveThreads()

int32_t OSCheckActiveThreads ( )

◆ OSCheckThreadStackUsage()

int32_t OSCheckThreadStackUsage ( OSThread thread)

◆ OSClearThreadStackUsage()

void OSClearThreadStackUsage ( OSThread thread)

◆ OSContinueThread()

void OSContinueThread ( OSThread thread)

◆ OSCreateThread()

BOOL OSCreateThread ( OSThread thread,
OSThreadEntryPointFn  entry,
int32_t  argc,
char *  argv,
void stack,
uint32_t  stackSize,
int32_t  priority,
OSThreadAttributes  attributes 
)
Here is the caller graph for this function:

◆ OSDetachThread()

void OSDetachThread ( OSThread thread)

◆ OSExitThread()

void OSExitThread ( int32_t  result)

◆ OSGetActiveThreadLink()

void OSGetActiveThreadLink ( OSThread thread,
OSThreadLink link 
)

◆ OSGetCurrentThread()

OSThread* OSGetCurrentThread ( )

◆ OSGetDefaultThread()

OSThread* OSGetDefaultThread ( uint32_t  coreID)

◆ OSGetStackPointer()

uint32_t OSGetStackPointer ( )

◆ OSGetThreadAffinity()

uint32_t OSGetThreadAffinity ( OSThread thread)

◆ OSGetThreadName()

const char* OSGetThreadName ( OSThread thread)

◆ OSGetThreadPriority()

int32_t OSGetThreadPriority ( OSThread thread)

◆ OSGetThreadSpecific()

uint32_t OSGetThreadSpecific ( uint32_t  id)

◆ OSInitThreadQueue()

void OSInitThreadQueue ( OSThreadQueue queue)
Here is the caller graph for this function:

◆ OSInitThreadQueueEx()

void OSInitThreadQueueEx ( OSThreadQueue queue,
void parent 
)

◆ OSIsThreadSuspended()

BOOL OSIsThreadSuspended ( OSThread thread)

◆ OSIsThreadTerminated()

BOOL OSIsThreadTerminated ( OSThread thread)

◆ OSJoinThread()

BOOL OSJoinThread ( OSThread thread,
int *  threadResult 
)
Here is the caller graph for this function:

◆ OSResumeThread()

int32_t OSResumeThread ( OSThread thread)
Here is the caller graph for this function:

◆ OSRunThread()

BOOL OSRunThread ( OSThread thread,
OSThreadEntryPointFn  entry,
int  argc,
const char **  argv 
)

◆ OSSetThreadAffinity()

BOOL OSSetThreadAffinity ( OSThread thread,
uint32_t  affinity 
)

◆ OSSetThreadCancelState()

BOOL OSSetThreadCancelState ( BOOL  state)

◆ OSSetThreadCleanupCallback()

OSThreadCleanupCallbackFn OSSetThreadCleanupCallback ( OSThread thread,
OSThreadCleanupCallbackFn  callback 
)
Here is the caller graph for this function:

◆ OSSetThreadDeallocator()

OSThreadDeallocatorFn OSSetThreadDeallocator ( OSThread thread,
OSThreadDeallocatorFn  deallocator 
)

◆ OSSetThreadName()

void OSSetThreadName ( OSThread thread,
const char *  name 
)

◆ OSSetThreadPriority()

BOOL OSSetThreadPriority ( OSThread thread,
int32_t  priority 
)

◆ OSSetThreadRunQuantum()

BOOL OSSetThreadRunQuantum ( OSThread thread,
uint32_t  quantum 
)

◆ OSSetThreadSpecific()

void OSSetThreadSpecific ( uint32_t  id,
uint32_t  value 
)

◆ OSSetThreadStackUsage()

BOOL OSSetThreadStackUsage ( OSThread thread)

◆ OSSleepThread()

void OSSleepThread ( OSThreadQueue queue)
Here is the caller graph for this function:

◆ OSSleepTicks()

void OSSleepTicks ( OSTime  ticks)
Here is the caller graph for this function:

◆ OSSuspendThread()

uint32_t OSSuspendThread ( OSThread thread)

◆ OSTestThreadCancel()

void OSTestThreadCancel ( )

◆ OSWakeupThread()

void OSWakeupThread ( OSThreadQueue queue)

◆ OSYieldThread()

void OSYieldThread ( )
Here is the caller graph for this function: