Synchronization between the application calling thread and the thread that is running the RIP. Having this synchronization simplifies the application code because it doesn't need to worry about callbacks on the monitor or raster functions happening asynchronously - they will only happen when the application has called into one of the SwLe functions and is blocked waiting for the result. More...
#include "skinkit.h"
#include "sync.h"
#include "mem.h"
#include "ripthread.h"
#include "threadapi.h"
#include <locale.h>
Functions | |
static void * | StartRipWrapper (void *unused) |
Wrapper to call StartRip() so we have the correct prototype for the thread starting functions. | |
HqBool | StartRIPOnNewThread (void) |
Create a thread and then call the function StartRip() to start a Harlequin Core RIP on it. More... | |
void | WaitForRIPThreadToExit (void) |
Wait for the RIP thread to exit. | |
void * | PKCreateSemaphore (int32 initialValue) |
Create a semaphore with an initial value. More... | |
HqBool | PKSignalSemaphore (void *semaHandle) |
Increment the value of a semaphore. More... | |
HqBool | PKWaitOnSemaphore (void *semaHandle) |
Wait on a semaphore. More... | |
void | PKDestroySemaphore (void *semaHandle) |
Free up the resources associated with the semaphore. More... | |
void | PKSemaFinish (void) |
Finish semaphore module, free up resources for remaining semaphores. | |
Synchronization between the application calling thread and the thread that is running the RIP. Having this synchronization simplifies the application code because it doesn't need to worry about callbacks on the monitor or raster functions happening asynchronously - they will only happen when the application has called into one of the SwLe functions and is blocked waiting for the result.
void* PKCreateSemaphore | ( | int32 | initialValue | ) |
Create a semaphore with an initial value.
initialValue | Initial value of the semaphore. |
void PKDestroySemaphore | ( | void * | semaHandle | ) |
Free up the resources associated with the semaphore.
semaHandle | Platform-specific handle to a semaphore created by PKCreateSemaphore(). |
HqBool PKSignalSemaphore | ( | void * | semaHandle | ) |
Increment the value of a semaphore.
semaHandle | Platform-specific handle to a semaphore created by PKCreateSemaphore(). |
If any threads are blocked in PKWaitOnSemaphore(), then wake them up.
TRUE | If the semaphore was incremented successfully; |
FALSE | otherwise. |
HqBool PKWaitOnSemaphore | ( | void * | semaHandle | ) |
Wait on a semaphore.
semaHandle | Platform-specific handle to a semaphore created by PKCreateSemaphore(). |
If the semaphore value is > 0 then decrement it and carry on. If it's already 0 then block until it is signalled with PKSignalSemaphore(), then decrement it and return.
TRUE | If the semaphore was decremented successfully; |
FALSE | otherwise. |
HqBool StartRIPOnNewThread | ( | void | ) |
Create a thread and then call the function StartRip() to start a Harlequin Core RIP on it.
TRUE | if the thread was created successfully; |
FALSE | if the thread was not created successfully. |