-
Notifications
You must be signed in to change notification settings - Fork 13
Threading and synchronizations routines
This category contains functions/types for dealing with concurrent programming, such as threads, mutexes, conditions, etc. More...
| Type | Name |
|---|---|
| struct |
fplConditionVariable Stores the condition variable structure. More... |
| union |
fplInternalConditionVariable Stores the internal condition variable for any platform. More... |
| union |
fplInternalMutexHandle Stores the internal mutex handle for any platform. More... |
| union |
fplInternalSemaphoreHandle Stores the internal semaphore handle for any platform. More... |
| union |
fplInternalSignalHandle Stores the internal signal handle for any platform. More... |
| union |
fplInternalThreadHandle Stores the thread handle for any platform. More... |
| struct |
fplMutexHandle Stores the mutex handle structure. More... |
| struct |
fplSemaphoreHandle Stores the semaphore handle structure. More... |
| struct |
fplSignalHandle Stores the signal handle structure. More... |
| struct |
fplThreadHandle Stores the thread handle structure. More... |
| struct |
fplThreadParameters Stores creation parameters for fplThreadCreateWithParameters(). More... |
| Type | Name |
|---|---|
| typedef void |
fpl_run_thread_callback(const fplThreadHandle *thread, void *data) A function definition for a callback to execute user code inside another thread. |
| typedef uint32_t |
fplThreadState A type definition that maps fplThreadStates into a 32-bit integer for atomic storage. |
| Type | Name |
|---|---|
| enum |
fplSignalValue { fplSignalValue_Unset , fplSignalValue_Set } An enumeration of signal values. More... |
| enum |
fplThreadPriority { fplThreadPriority_Unknown , fplThreadPriority_Idle , fplThreadPriority_Low , fplThreadPriority_Normal , fplThreadPriority_High , fplThreadPriority_RealTime , fplThreadPriority_Lowest , fplThreadPriority_Highest , fplThreadPriority_First , fplThreadPriority_Last } Defines all possible thread priorities. More... |
| enum |
fplThreadStates { fplThreadState_Stopped , fplThreadState_Starting , fplThreadState_Running , fplThreadState_Stopping } An enumeration of thread states. More... |
| Type | Name |
|---|---|
| fpl_platform_api bool |
fplConditionBroadcast (fplConditionVariable *condition) Wakes up all threads that wait on the given condition. |
| fpl_platform_api void |
fplConditionDestroy (fplConditionVariable *condition) Releases the given condition and clears the structure to zero. |
| fpl_platform_api bool |
fplConditionInit (fplConditionVariable *condition) Initializes the given condition. |
| fpl_platform_api bool |
fplConditionSignal (fplConditionVariable *condition) Wakes up one thread that waits on the given condition. |
| fpl_platform_api bool |
fplConditionWait (fplConditionVariable *condition, fplMutexHandle *mutex, const fplTimeoutValue timeout) Sleeps on the given condition and releases the mutex when done. |
| fpl_common_api size_t |
fplGetAvailableThreadCount (void) Gets the number of available threads. |
| fpl_platform_api uint64_t |
fplGetCurrentThreadId (void) Gets the thread id for the current thread. |
| fpl_common_api const fplThreadHandle * |
fplGetMainThread (void) Gets the thread handle for the main thread. |
| fpl_platform_api fplThreadPriority |
fplGetThreadPriority (fplThreadHandle *thread) Retrieves the current thread priority from the OS for the given thread handle. |
| fpl_common_api fplThreadState |
fplGetThreadState (fplThreadHandle *thread) Gets the current thread state for the given thread. |
| fpl_common_api size_t |
fplGetUsedThreadCount (void) Gets the number of used/active threads. |
| fpl_platform_api void |
fplMutexDestroy (fplMutexHandle *mutex) Releases the given mutex and clears the structure to zero. |
| fpl_platform_api bool |
fplMutexInit (fplMutexHandle *mutex) Initializes the given mutex. |
| fpl_platform_api bool |
fplMutexLock (fplMutexHandle *mutex) Locks the given mutex and blocks any other threads. |
| fpl_platform_api bool |
fplMutexTryLock (fplMutexHandle *mutex) Tries to lock the given mutex without blocking other threads. |
| fpl_platform_api bool |
fplMutexUnlock (fplMutexHandle *mutex) Unlocks the given mutex. |
| fpl_platform_api void |
fplSemaphoreDestroy (fplSemaphoreHandle *semaphore) Releases the internal semaphore resources. |
| fpl_platform_api bool |
fplSemaphoreInit (fplSemaphoreHandle *semaphore, const uint32_t initialValue) Initializes the semaphore with the given initial value. |
| fpl_platform_api bool |
fplSemaphoreRelease (fplSemaphoreHandle *semaphore) Increments the semaphore value by one. |
| fpl_platform_api bool |
fplSemaphoreTryWait (fplSemaphoreHandle *semaphore) Tries to wait for the semaphore until it gets signaled or returns immediately. |
| fpl_platform_api int32_t |
fplSemaphoreValue (fplSemaphoreHandle *semaphore) Gets the current semaphore value. |
| fpl_platform_api bool |
fplSemaphoreWait (fplSemaphoreHandle *semaphore, const fplTimeoutValue timeout) Waits for the semaphore until it gets signaled or the timeout has been reached. |
| fpl_platform_api bool |
fplSetThreadPriority (fplThreadHandle *thread, const fplThreadPriority newPriority) Changes the thread priority to the given one, for the given thread handle. |
| fpl_platform_api void |
fplSignalDestroy (fplSignalHandle *signal) Releases the given signal and clears the structure to zero. |
| fpl_platform_api bool |
fplSignalInit (fplSignalHandle *signal, const fplSignalValue initialValue) Initializes the given signal. |
| fpl_platform_api bool |
fplSignalReset (fplSignalHandle *signal) Resets the signal. |
| fpl_platform_api bool |
fplSignalSet (fplSignalHandle *signal) Sets the signal and wakes up the given signal. |
| fpl_platform_api bool |
fplSignalWaitForAll (fplSignalHandle **signals, const size_t count, const size_t stride, const fplTimeoutValue timeout) Waits until all the given signals are woken up. |
| fpl_platform_api bool |
fplSignalWaitForAny (fplSignalHandle **signals, const size_t count, const size_t stride, const fplTimeoutValue timeout) Waits until any of the given signals wakes up or the timeout has been reached. |
| fpl_platform_api bool |
fplSignalWaitForOne (fplSignalHandle *signal, const fplTimeoutValue timeout) Waits until the given signal is woken up. |
| fpl_platform_api fplThreadHandle * |
fplThreadCreate (fpl_run_thread_callback *runFunc, void *data) Creates and starts a thread and returns the handle to it. |
| fpl_platform_api fplThreadHandle * |
fplThreadCreateWithParameters (fplThreadParameters *parameters) Creates and starts a thread from the specified parameters and returns the handle to it. |
| fpl_platform_api void |
fplThreadSleep (const uint32_t milliseconds) Lets the current thread sleep for the given amount of milliseconds. |
| fpl_platform_api bool |
fplThreadTerminate (fplThreadHandle *thread) Forces the given thread to stop and release all underlying resources. |
| fpl_platform_api bool |
fplThreadWaitForAll (fplThreadHandle **threads, const size_t count, const size_t stride, const fplTimeoutValue timeout) Waits until all given threads are done running or the given timeout has been reached. |
| fpl_platform_api bool |
fplThreadWaitForAny (fplThreadHandle **threads, const size_t count, const size_t stride, const fplTimeoutValue timeout) Waits until one of the given threads is done running or the given timeout has been reached. |
| fpl_platform_api bool |
fplThreadWaitForOne (fplThreadHandle *thread, const fplTimeoutValue timeout) Waits until the given thread is done running or the given timeout has been reached. |
| fpl_platform_api bool |
fplThreadYield (void) Lets the current thread yield execution to another thread that is ready to run on this core. |
This category contains functions/types for dealing with concurrent programming, such as threads, mutexes, conditions, etc.
typedef void fpl_run_thread_callback(const fplThreadHandle *thread, void *data)A function definition for a callback to execute user code inside another thread.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | thread | Reference to the thread handle fplThreadHandle. |
| [in] | data | Reference to the user data pointer. |
Definition at line 7374 of file final_platform_layer.h.
typedef uint32_t fplThreadStateA type definition that maps fplThreadStates into a 32-bit integer for atomic storage.
Definition at line 7334 of file final_platform_layer.h.
enum fplSignalValueAn enumeration of signal values.
| Name | Description |
|---|---|
| fplSignalValue_Unset | Value is unset. |
| fplSignalValue_Set | Value is set. |
Definition at line 7537 of file final_platform_layer.h.
enum fplThreadPriorityDefines all possible thread priorities.
| Name | Description |
|---|---|
| fplThreadPriority_Unknown | Unknown priority. |
| fplThreadPriority_Idle | Idle priority (Only when nothing is going on). |
| fplThreadPriority_Low | Low priority. |
| fplThreadPriority_Normal | Normal priority. |
| fplThreadPriority_High | High priority. |
| fplThreadPriority_RealTime | Realtime priority (Time critical). |
| fplThreadPriority_Lowest | Lowest fplThreadPriority. |
| fplThreadPriority_Highest | Highest fplThreadPriority. |
| fplThreadPriority_First | First fplThreadPriority. |
| fplThreadPriority_Last | Last fplThreadPriority. |
Definition at line 7340 of file final_platform_layer.h.
enum fplThreadStatesAn enumeration of thread states.
Definition at line 7319 of file final_platform_layer.h.
fpl_platform_api bool fplConditionBroadcast ( fplConditionVariable * condition)Wakes up all threads that wait on the given condition.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | condition | Reference to the condition variable structure fplConditionVariable. |
Returns: Returns true when the function succeeds, false otherwise.
See also: Send a Condition-Variable Broadcast to all waiting Threads
fpl_platform_api void fplConditionDestroy ( fplConditionVariable * condition)Releases the given condition and clears the structure to zero.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | condition | Reference to the condition variable structure fplConditionVariable. |
See also: Initialize a Condition-Variable
fpl_platform_api bool fplConditionInit ( fplConditionVariable * condition)Initializes the given condition.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | condition | Reference to the condition variable structure fplConditionVariable. |
Returns: Returns true when initialization was successful, false otherwise.
Note: Use
fplConditionDestroy() when you are done with this Condition Variable to release its resources.
See also: Initialize a Condition-Variable
fpl_platform_api bool fplConditionSignal ( fplConditionVariable * condition)Wakes up one thread that waits on the given condition.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | condition | Reference to the condition variable structure fplConditionVariable. |
Returns: Returns true when the function succeeds, false otherwise.
See also: Send a Signal to a Condition-Variable to one waiting Thread
fpl_platform_api bool fplConditionWait ( fplConditionVariable * condition, fplMutexHandle * mutex, const fplTimeoutValue timeout )Sleeps on the given condition and releases the mutex when done.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | condition | Reference to the condition variable structure. |
| [in,out] | mutex | Reference to the mutex handle structure fplConditionVariable. |
| [in] | timeout | The number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE, it will wait indefinitely. |
Returns: Returns true when the function succeeds, false otherwise.
See also: Waiting on a Condition-Variable
fpl_common_api size_t fplGetAvailableThreadCount ( void )Gets the number of available threads.
Returns: Returns the number of available threads.
fpl_platform_api uint64_t fplGetCurrentThreadId ( void )Gets the thread id for the current thread.
Returns: Returns the thread id for the current thread.
fpl_common_api const fplThreadHandle * fplGetMainThread ( void )Gets the thread handle for the main thread.
Returns: Returns the immutable pointer to the thread handle.
fpl_platform_api fplThreadPriority fplGetThreadPriority ( fplThreadHandle * thread)Retrieves the current thread priority from the OS for the given thread handle.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | thread | Reference to the thread handle structure. |
Returns: Returns the current thread priority.
fpl_common_api fplThreadState fplGetThreadState ( fplThreadHandle * thread)Gets the current thread state for the given thread.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | thread | Reference to the thread handle. |
Returns: Returns the current thread state for the given thread.
See also: Query the Thread State
fpl_common_api size_t fplGetUsedThreadCount ( void )Gets the number of used/active threads.
Returns: Returns the number of used/active threads.
fpl_platform_api void fplMutexDestroy ( fplMutexHandle * mutex)Releases the given mutex and clears the structure to zero.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | mutex | Reference to the mutex handle structure fplMutexHandle. |
See also: Initialize a Mutex
fpl_platform_api bool fplMutexInit ( fplMutexHandle * mutex)Initializes the given mutex.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | mutex | Reference to the mutex handle structure fplMutexHandle. |
Returns: Returns true when the mutex was initialized, false otherwise.
Note: Use
fplMutexDestroy() when you are done with this mutex.
See also: Initialize a Mutex
fpl_platform_api bool fplMutexLock ( fplMutexHandle * mutex)Locks the given mutex and blocks any other threads.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | mutex | Reference to the mutex handle structure fplMutexHandle. |
Returns: Returns true when the mutex was locked, false otherwise.
See also: Locking a Mutex
fpl_platform_api bool fplMutexTryLock ( fplMutexHandle * mutex)Tries to lock the given mutex without blocking other threads.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | mutex | Reference to the mutex handle structure fplMutexHandle. |
Returns: Returns true when the mutex was locked, false otherwise.
See also: Trying to lock a Mutex
fpl_platform_api bool fplMutexUnlock ( fplMutexHandle * mutex)Unlocks the given mutex.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | mutex | Reference to the mutex handle structure fplMutexHandle. |
Returns: Returns true when the mutex was unlocked, false otherwise.
See also: Unlocking a Mutex
fpl_platform_api void fplSemaphoreDestroy ( fplSemaphoreHandle * semaphore)Releases the internal semaphore resources.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | semaphore | Reference to the semaphore handle structure fplSemaphoreHandle. |
Warning: Do not call this when a thread is still waiting on this semaphore.
See also: Initialize a Semaphore
fpl_platform_api bool fplSemaphoreInit ( fplSemaphoreHandle * semaphore, const uint32_t initialValue )Initializes the semaphore with the given initial value.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | semaphore | Reference to the semaphore handle structure fplSemaphoreHandle. |
| [in] | initialValue | The initial value. |
Returns: Returns true when the semaphore was initialized, false otherwise.
See also: Initialize a Semaphore
fpl_platform_api bool fplSemaphoreRelease ( fplSemaphoreHandle * semaphore)Increments the semaphore value by one.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | semaphore | Reference to the semaphore handle structure fplSemaphoreHandle. |
Returns: Returns true when the semaphore was incremented, false otherwise.
See also: Releasing the Semaphore
fpl_platform_api bool fplSemaphoreTryWait ( fplSemaphoreHandle * semaphore)Tries to wait for the semaphore until it gets signaled or returns immediately.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | semaphore | Reference to the semaphore handle structure fplSemaphoreHandle. |
Returns: Returns true when the semaphore got signaled, false otherwise.
Note: When a semaphore gets signaled, the semaphore value is decreased by one.
See also: Trying to wait on a Semaphore
fpl_platform_api int32_t fplSemaphoreValue ( fplSemaphoreHandle * semaphore)Gets the current semaphore value.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | semaphore | Reference to the semaphore handle structure fplSemaphoreHandle. |
Returns: Returns the current semaphore value.
See also: Reading the Value from the Semaphore
fpl_platform_api bool fplSemaphoreWait ( fplSemaphoreHandle * semaphore, const fplTimeoutValue timeout )Waits for the semaphore until it gets signaled or the timeout has been reached.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | semaphore | Reference to the semaphore handle structure fplSemaphoreHandle. |
| [in] | timeout | The number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE, it will wait indefinitely. |
Returns: Returns true when the semaphore got signaled, false otherwise.
Note: When a semaphore gets signaled, the semaphore value is decreased by one.
See also: Waiting/Locking a Semaphore
fpl_platform_api bool fplSetThreadPriority ( fplThreadHandle * thread, const fplThreadPriority newPriority )Changes the thread priority to the given one, for the given thread handle.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | thread | Reference to the thread handle structure. |
| [in] | newPriority | The new thread priority for the given thread. |
Returns: Returns true when the priority was changed, false otherwise.
fpl_platform_api void fplSignalDestroy ( fplSignalHandle * signal)Releases the given signal and clears the structure to zero.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | signal | Reference to the signal handle structure fplSignalHandle. |
See also: Initialize a Signal
fpl_platform_api bool fplSignalInit ( fplSignalHandle * signal, const fplSignalValue initialValue )Initializes the given signal.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | signal | Reference to the signal handle structure fplSignalHandle. |
| [in] | initialValue | The initial value the signal is set to. |
Returns: Returns true when initialization was successful, false otherwise.
Note: Use
fplSignalDestroy() when you are done with this Signal to release it.
See also: Initialize a Signal
fpl_platform_api bool fplSignalReset ( fplSignalHandle * signal)Resets the signal.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | signal | Reference to the signal handle structure fplSignalHandle. |
Returns: Returns true when the signal was reset, false otherwise.
See also: Resetting a Signal
fpl_platform_api bool fplSignalSet ( fplSignalHandle * signal)Sets the signal and wakes up the given signal.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | signal | Reference to the signal handle structure fplSignalHandle. |
Returns: Returns true when the signal was set and broadcasted, false otherwise.
See also: Setting a Signal
fpl_platform_api bool fplSignalWaitForAll ( fplSignalHandle ** signals, const size_t count, const size_t stride, const fplTimeoutValue timeout )Waits until all the given signals are woken up.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | signals | Reference to the first signal handle structure fplSignalHandle. |
| [in] | count | The number of signals. |
| [in] | stride | The size in bytes to the next signal handle. When this is set to zero, the array default is used. |
| [in] | timeout | The number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE, it will wait indefinitely. |
Returns: Returns true when all signals woke up or the timeout has been reached, false otherwise.
See also: Wait for all Signals to be set
fpl_platform_api bool fplSignalWaitForAny ( fplSignalHandle ** signals, const size_t count, const size_t stride, const fplTimeoutValue timeout )Waits until any of the given signals wakes up or the timeout has been reached.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | signals | Reference to the first signal handle structure fplSignalHandle. |
| [in] | count | The number of signals. |
| [in] | stride | The size in bytes to the next signal handle. When this is set to zero, the array default is used. |
| [in] | timeout | The number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE, it will wait indefinitely. |
Returns: Returns true when any of the signals woke up or the timeout has been reached, false otherwise.
See also: Wait for any Signal to be set
fpl_platform_api bool fplSignalWaitForOne ( fplSignalHandle * signal, const fplTimeoutValue timeout )Waits until the given signal is woken up.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | signal | Reference to the signal handle structure fplSignalHandle. |
| [in] | timeout | The number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE, it will wait indefinitely. |
Returns: Returns true when the signal woke up or the timeout has been reached, false otherwise.
See also: Wait for a single Signal to be set
fpl_platform_api fplThreadHandle * fplThreadCreate ( fpl_run_thread_callback * runFunc, void * data )Creates and starts a thread and returns the handle to it.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | runFunc | Reference to the run thread callback fpl_run_thread_callback. |
| [in] | data | Reference to the user data pointer passed to the execution function callback. |
Returns: Returns a pointer to the thread handle structure or null when the limit of active threads has been reached.
Warning: Do not free this thread context directly!
Note: The resources are automatically cleaned up when the thread terminates.
See also: Creating a Thread
fpl_platform_api fplThreadHandle * fplThreadCreateWithParameters ( fplThreadParameters * parameters)Creates and starts a thread from the specified parameters and returns the handle to it.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | parameters | Reference to the thread parameters fplThreadParameters. |
Returns: Returns a pointer to the thread handle structure or null when the limit of active threads has been reached.
Warning: Do not free this thread context directly!
Note: The resources are automatically cleaned up when the thread terminates.
fpl_platform_api void fplThreadSleep ( const uint32_t milliseconds)Lets the current thread sleep for the given amount of milliseconds.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | milliseconds | Number of milliseconds to sleep. |
Note: There is no guarantee that the OS sleeps for the exact amount of milliseconds! This can vary based on the OS scheduler's granularity.
fpl_platform_api bool fplThreadTerminate ( fplThreadHandle * thread)Forces the given thread to stop and release all underlying resources.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | thread | Reference to the thread handle structure. |
Returns: Returns true when the thread was terminated, false otherwise.
Warning: Do not free the given thread context manually!
Note: This thread context may get re-used for another thread in the future.
See also: Terminate a thread
fpl_platform_api bool fplThreadWaitForAll ( fplThreadHandle ** threads, const size_t count, const size_t stride, const fplTimeoutValue timeout )Waits until all given threads are done running or the given timeout has been reached.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | threads | Reference to the first thread handle pointer. |
| [in] | count | The number of threads. |
| [in] | stride | The size in bytes to the next thread handle. When this is set to zero, the array default is used. |
| [in] | timeout | The number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE, it will wait indefinitely. |
Returns: Returns true when all threads complete or when the timeout has been reached, false otherwise.
See also: Wait for all Threads to Exit
fpl_platform_api bool fplThreadWaitForAny ( fplThreadHandle ** threads, const size_t count, const size_t stride, const fplTimeoutValue timeout )Waits until one of the given threads is done running or the given timeout has been reached.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | threads | Reference to the first thread handle fplThreadHandle. |
| [in] | count | The number of threads. |
| [in] | stride | The size in bytes to the next thread handle. When this is set to zero, the size of the thread handle is used. |
| [in] | timeout | The number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE, it will wait indefinitely. |
Returns: Returns true when one thread completes or when the timeout has been reached, false otherwise.
See also: Wait for any Thread to Exit
fpl_platform_api bool fplThreadWaitForOne ( fplThreadHandle * thread, const fplTimeoutValue timeout )Waits until the given thread is done running or the given timeout has been reached.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | thread | Reference to the thread handle structure. |
| [in] | timeout | The number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE, it will wait indefinitely. |
Returns: Returns true when the thread completes or when the timeout has been reached, false otherwise.
See also: Wait for a single Thread to Exit
fpl_platform_api bool fplThreadYield ( void )Lets the current thread yield execution to another thread that is ready to run on this core.
Returns: Returns true when the function succeeds, false otherwise.
- Assertion & Debug
- Atomic operations
- Audio functions
- Clipboard functions
- Console functions
- Constants
- Display/Monitor functions
- Dynamic library loading
- Error Handling
- Files/IO functions
- Function macros
- Hardware Infos
- Input types and functions
- Localization functions
- Logging
- Memory Macros
- Memory functions
- Operating system Infos
- Path functions
- Platform functions
- Session Infos
- Settings & Configurations
- Storage class identifiers
- String functions
- Threading and synchronizations routines
- Timing functions
- Video functions
- Window events
- Window functions
- fplARMCPUCapabilities
- fplAudioChannelMap
- fplAudioDeviceID
- fplAudioDeviceInfo
- fplAudioFormat
- fplAudioSettings
- fplColor32
- fplConditionVariable
- fplConsoleSettings
- fplCPUCapabilities
- fplCPUIDLeaf
- fplDateTime
- fplDateTimeCreationResult
- fplDateTimeResult
- fplDisplayInfo
- fplDisplayMode
- fplDynamicLibraryHandle
- fplEndianess
- fplEvent
- fplFileEntry
- fplFileHandle
- fplFilePermissions
- fplFileTimeStamps
- fplGamepadButton
- fplGamepadData
- fplGamepadEvent
- fplGamepadInfo
- fplGamepadInputBinding
- fplGamepadMapping
- fplGamepadSettings
- fplGamepadState
- fplGamepadStates
- fplGraphicsApiSettings
- fplImageSource
- fplInputBackendMask
- fplInputBackendSupport
- fplInputDevice
- fplInputDeviceGuid
- fplInputSettings
- fplInternalConditionVariable
- fplInternalDynamicLibraryHandle
- fplInternalFileEntryHandle
- fplInternalFileHandle
- fplInternalFileRootInfo
- fplInternalMutexHandle
- fplInternalSemaphoreHandle
- fplInternalSignalHandle
- fplInternalThreadHandle
- fplKeyboardEvent
- fplKeyboardState
- fplLogSettings
- fplLogWriter
- fplLogWriterConsole
- fplLogWriterCustom
- fplMemoryAllocationSettings
- fplMemoryBlock
- fplMemoryInfos
- fplMemorySettings
- fplMouseEvent
- fplMouseState
- fplMutexHandle
- fplOpenGLSettings
- fplOSVersionInfos
- fplSemaphoreHandle
- fplSettings
- fplSignalHandle
- fplSpecificAudioSettings
- fplThreadHandle
- fplThreadParameters
- fplTimestamp
- fplVersionInfo
- fplVideoBackBuffer
- fplVideoRect
- fplVideoRequirements
- fplVideoRequirementsVulkan
- fplVideoSettings
- fplVideoSurface
- fplVideoSurfaceOpenGL
- fplVideoSurfaceVulkan
- fplVideoWindow
- fplVulkanSettings
- fplWindowCallbacks
- fplWindowDropFiles
- fplWindowEvent
- fplWindowPosition
- fplWindowSettings
- fplWindowSize
- fplX86CPUCapabilities