inline void videoDrawFrame ( videoData *vdata ) { /* wait vsync */ rescWaitFlip () ; /* update text */ sysSemWait ( vdata->fon_buffer->sem, NO_TIMEOUT ) ; fontBufferDraw ( vdata->context, vdata->fon_buffer, &vdata->rsx_buffers[vdata->currentBuffer] ) ; sysSemPost ( vdata->fon_buffer->sem, 1 ) ; /* flip buffer to screen */ rescFlip ( vdata ) ; }
/* Atomically increases the semaphore's count (not blocking) */ int SDL_SemPost(SDL_sem * sem) { if (!sem) { SDL_SetError("Passed a NULL semaphore"); return -1; } if (sysSemPost(sem->id, 1) != 0) { SDL_SetError("release_sem() failed"); return -1; } return 0; }
pte_osResult pte_osThreadCancel(pte_osThreadHandle threadHandle) { pte_osResult osResult; s32 result; psl1ghtThreadData *pThreadData; pThreadData = getThreadData(threadHandle); result = sysSemPost(pThreadData->cancelSem, 1); if (result == 0) { osResult = PTE_OS_OK; } else { osResult = PTE_OS_GENERAL_FAILURE; } return osResult; }
pte_osResult pte_osSemaphorePost(pte_osSemaphoreHandle handle, int count) { sysSemPost(handle, count); return PTE_OS_OK; }