#include <ofxMultiThread.h>
Public Attributes | |
OfxStatus(* | multiThread )(OfxThreadFunctionV1 func, unsigned int nThreads, void *customArg) |
Function to spawn SMP threads. | |
OfxStatus(* | multiThreadNumCPUs )(unsigned int *nCPUs) |
Function which indicates the number of CPUs available for SMP processing. | |
OfxStatus(* | multiThreadIndex )(unsigned int *threadIndex) |
Function which indicates the index of the current thread. | |
int(* | multiThreadIsSpawnedThread )(void) |
Function to enquire if the calling thread was spawned by multiThread. | |
OfxStatus(* | mutexCreate )(const OfxMutexHandle *mutex, int lockCount) |
Create a mutex. | |
OfxStatus(* | mutexDestroy )(const OfxMutexHandle mutex) |
Destroy a mutex. | |
OfxStatus(* | mutexLock )(const OfxMutexHandle mutex) |
Blocking lock on the mutex. | |
OfxStatus(* | mutexUnLock )(const OfxMutexHandle mutex) |
Unlock the mutex. | |
OfxStatus(* | mutexTryLock )(const OfxMutexHandle mutex) |
Non blocking attempt to lock the mutex. |
OfxStatus(* OfxMultiThreadSuiteV1::multiThread)(OfxThreadFunctionV1 func, unsigned int nThreads, void *customArg) |
Function to spawn SMP threads.
multiThread will not return until all the spawned threads have returned. It is up to the host how it waits for all the threads to return (busy wait, blocking, whatever).
nThreads can be more than the value returned by multiThreadNumCPUs, however the threads will be limitted to the number of CPUs returned by multiThreadNumCPUs.
This function cannot be called recursively.
OfxStatus(* OfxMultiThreadSuiteV1::multiThreadNumCPUs)(unsigned int *nCPUs) |
Function which indicates the number of CPUs available for SMP processing.
OfxStatus(* OfxMultiThreadSuiteV1::multiThreadIndex)(unsigned int *threadIndex) |
Function which indicates the index of the current thread.
If there are no threads currently spawned, then this function will set threadIndex to 0
int(* OfxMultiThreadSuiteV1::multiThreadIsSpawnedThread)(void) |
Function to enquire if the calling thread was spawned by multiThread.
OfxStatus(* OfxMultiThreadSuiteV1::mutexCreate)(const OfxMutexHandle *mutex, int lockCount) |
Create a mutex.
OfxStatus(* OfxMultiThreadSuiteV1::mutexDestroy)(const OfxMutexHandle mutex) |
Destroy a mutex.
Destroys a mutex intially created by mutexCreate.
OfxStatus(* OfxMultiThreadSuiteV1::mutexLock)(const OfxMutexHandle mutex) |
Blocking lock on the mutex.
This trys to lock a mutex and blocks the thread it is in until the lock suceeds.
A sucessful lock causes the mutex's lock count to be increased by one and to block any other calls to lock the mutex until it is unlocked.
OfxStatus(* OfxMultiThreadSuiteV1::mutexUnLock)(const OfxMutexHandle mutex) |
Unlock the mutex.
This unlocks a mutex. Unlocking a mutex decreases its lock count by one.
OfxStatus(* OfxMultiThreadSuiteV1::mutexTryLock)(const OfxMutexHandle mutex) |
Non blocking attempt to lock the mutex.
This attempts to lock a mutex, if it cannot, it returns and says so, rather than blocking.
A sucessful lock causes the mutex's lock count to be increased by one, if the lock did not suceed, the call returns immediately and the lock count remains unchanged.