13 void _gosHeapInit(
void);
19 if (!osKernelRunning())
21 #elif !GFX_OS_INIT_NO_WARNING
22 #if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
23 #warning "GOS: Operating System initialization has been turned off. Make sure you call osKernelInitialize() and osKernelStart() before gfxInit() in your application!"
24 #elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
25 COMPILER_WARNING(
"GOS: Operating System initialization has been turned off. Make sure you call osKernelInitialize() and osKernelStart() before gfxInit() in your application!")
33 void _gosPostInit(
void)
44 def.mutex = pmutex->mutex;
46 pmutex->id = osMutexCreate(&def);
52 def.semaphore = psem->semaphore;
54 if (val > limit) val = limit;
55 psem->available = limit - val;
56 psem->id = osSemaphoreCreate(&def, val);
61 osSemaphoreDelete(psem->id);
66 if (osSemaphoreWait(psem->id, ms) > 0) {
85 if (psem->available) {
87 osSemaphoreRelease(psem->id);
97 def.pthread = (os_pthread)fn;
100 def.stacksize = stacksz;
102 return osThreadCreate(&def, param);
106 while(osThreadGetPriority(thread) == osPriorityError)
gThreadreturn gfxThreadWait(gThread thread)
Wait for a thread to finish.
void gfxSemSignal(gSem *psem)
Signal a semaphore.
void * gThread
A thread handle.
void gfxYield(void)
Yield the current thread.
#define GFX_THREAD_FUNCTION(fnName, param)
Declare a thread function.
gBool gfxSemWait(gSem *psem, gDelay ms)
Wait on a semaphore.
void gfxMutexInit(gMutex *pmutex)
Initialise a mutex to protect a region of code from other threads.
gThread gfxThreadCreate(void *stackarea, gMemSize stacksz, gThreadpriority prio, GFX_THREAD_FUNCTION((*fn), p), void *param)
Start a new thread.
gBool gfxSemWaitI(gSem *psem)
Test if a wait on a semaphore can be satisfied immediately.
void gfxSemDestroy(gSem *psem)
Destroy a Counted Semaphore.
void gfxSemInit(gSem *psem, gSemcount val, gSemcount limit)
Initialise a Counted Semaphore.
void gfxSemSignalI(gSem *psem)
Signal a semaphore.