Final Platform Layer  0.9.6-beta
Data Structures | Macros | Typedefs | Enumerations | Functions
Threading and synchronizations routines

This category contains functions/types for dealing with concurrent programming, such as threads, mutexes, conditions, etc. More...

Data Structures

struct  fplConditionVariable
 The condition variable structure. More...
 
union  fplInternalConditionVariable
 A union containing the internal condition variable for any platform. More...
 
union  fplInternalMutexHandle
 A union containing the internal mutex handle for any platform. More...
 
union  fplInternalSemaphoreHandle
 A union containing the internal semaphore handle for any platform. More...
 
union  fplInternalSignalHandle
 A union containing the internal signal handle for any platform. More...
 
union  fplInternalThreadHandle
 A union containing the thread handle for any platform. More...
 
struct  fplMutexHandle
 The mutex handle structure. More...
 
struct  fplSemaphoreHandle
 The semaphore handle structure. More...
 
struct  fplSignalHandle
 The signal handle structure. More...
 
struct  fplThreadHandle
 The thread handle structure. More...
 
struct  fplThreadParameters
 Contains creation parameters for fplThreadCreateWithParameters() More...
 

Macros

#define FPL_TIMEOUT_INFINITE
 Infinite timeout constant.
 

Typedefs

typedef void() fpl_run_thread_callback(const fplThreadHandle *thread, void *data)
 A callback to execute user code inside another thread. More...
 
typedef struct fplConditionVariable fplConditionVariable
 The condition variable structure.
 
typedef union fplInternalConditionVariable fplInternalConditionVariable
 A union containing the internal condition variable for any platform.
 
typedef union fplInternalMutexHandle fplInternalMutexHandle
 A union containing the internal mutex handle for any platform.
 
typedef union fplInternalSemaphoreHandle fplInternalSemaphoreHandle
 A union containing the internal semaphore handle for any platform.
 
typedef union fplInternalSignalHandle fplInternalSignalHandle
 A union containing the internal signal handle for any platform.
 
typedef union fplInternalThreadHandle fplInternalThreadHandle
 A union containing the thread handle for any platform.
 
typedef struct fplMutexHandle fplMutexHandle
 The mutex handle structure.
 
typedef struct fplSemaphoreHandle fplSemaphoreHandle
 The semaphore handle structure.
 
typedef struct fplSignalHandle fplSignalHandle
 The signal handle structure.
 
typedef enum fplSignalValue fplSignalValue
 An enumeration of signal values.
 
typedef struct fplThreadHandle fplThreadHandle
 Forward declared thread handle. More...
 
typedef struct fplThreadParameters fplThreadParameters
 Contains creation parameters for fplThreadCreateWithParameters()
 
typedef enum fplThreadPriority fplThreadPriority
 Defines all possible thread priorities.
 
typedef uint32_t fplThreadState
 A type definition for mapping fplThreadState into a 32-bit integer.
 
typedef enum fplThreadStates fplThreadStates
 An enumeration of thread states.
 
typedef uint32_t fplTimeoutValue
 A type definition for a timeout value in milliseconds.
 

Enumerations

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...
 

Functions

fpl_platform_api bool fplConditionBroadcast (fplConditionVariable *condition)
 Wakes up all threads that wait on the given condition. More...
 
fpl_platform_api void fplConditionDestroy (fplConditionVariable *condition)
 Releases the given condition and clears the structure to zero. More...
 
fpl_platform_api bool fplConditionInit (fplConditionVariable *condition)
 Initialize s the given condition. More...
 
fpl_platform_api bool fplConditionSignal (fplConditionVariable *condition)
 Wakes up one thread that waits on the given condition. More...
 
fpl_platform_api bool fplConditionWait (fplConditionVariable *condition, fplMutexHandle *mutex, const fplTimeoutValue timeout)
 Sleeps on the given condition and releases the mutex when done. More...
 
fpl_platform_api uint32_t fplGetCurrentThreadId ()
 Gets the thread id for the current thread. More...
 
const fpl_common_api fplThreadHandlefplGetMainThread ()
 Gets the thread handle for the main thread. More...
 
fpl_platform_api fplThreadPriority fplGetThreadPriority (fplThreadHandle *thread)
 Retrieves the current thread priority from the OS from the given fplThreadHandle . More...
 
fpl_common_api fplThreadState fplGetThreadState (fplThreadHandle *thread)
 Gets the current thread state for the given thread. More...
 
fpl_platform_api void fplMutexDestroy (fplMutexHandle *mutex)
 Releases the given mutex and clears the structure to zero. More...
 
fpl_platform_api bool fplMutexInit (fplMutexHandle *mutex)
 Initializes the given mutex. More...
 
fpl_platform_api bool fplMutexLock (fplMutexHandle *mutex)
 Locks the given mutex and blocks any other threads. More...
 
fpl_platform_api bool fplMutexTryLock (fplMutexHandle *mutex)
 Tries to lock the given mutex without blocking other threads. More...
 
fpl_platform_api bool fplMutexUnlock (fplMutexHandle *mutex)
 Unlocks the given mutex. More...
 
fpl_platform_api void fplSemaphoreDestroy (fplSemaphoreHandle *semaphore)
 Releases the internal semaphore resources. More...
 
fpl_platform_api bool fplSemaphoreInit (fplSemaphoreHandle *semaphore, const uint32_t initialValue)
 Initializes the semaphore with the given initial value. More...
 
fpl_platform_api bool fplSemaphoreRelease (fplSemaphoreHandle *semaphore)
 Increments the semaphore value by one. More...
 
fpl_platform_api bool fplSemaphoreTryWait (fplSemaphoreHandle *semaphore)
 Tries to wait for the semaphore until it gets signaled or return immediately. More...
 
fpl_platform_api int32_t fplSemaphoreValue (fplSemaphoreHandle *semaphore)
 Gets the current semaphore value. More...
 
fpl_platform_api bool fplSemaphoreWait (fplSemaphoreHandle *semaphore, const fplTimeoutValue timeout)
 Waits for the semaphore until it gets signaled or the timeout has been reached. More...
 
fpl_platform_api bool fplSetThreadPriority (fplThreadHandle *thread, const fplThreadPriority newPriority)
 Changes the thread priority to the given one, for the given fplThreadHandle . More...
 
fpl_platform_api void fplSignalDestroy (fplSignalHandle *signal)
 Releases the given signal and clears the structure to zero. More...
 
fpl_platform_api bool fplSignalInit (fplSignalHandle *signal, const fplSignalValue initialValue)
 Initializes the given signal. More...
 
fpl_platform_api bool fplSignalReset (fplSignalHandle *signal)
 Resets the signal. More...
 
fpl_platform_api bool fplSignalSet (fplSignalHandle *signal)
 Sets the signal and wakes up the given signal. More...
 
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 waked up. More...
 
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. More...
 
fpl_platform_api bool fplSignalWaitForOne (fplSignalHandle *signal, const fplTimeoutValue timeout)
 Waits until the given signal is waked up. More...
 
fpl_platform_api fplThreadHandlefplThreadCreate (fpl_run_thread_callback *runFunc, void *data)
 Creates and starts a thread and returns the handle to it. More...
 
fpl_platform_api fplThreadHandlefplThreadCreateWithParameters (fplThreadParameters *parameters)
 Creates and starts a thread from the specified fplThreadParameters and returns the handle to it. More...
 
fpl_platform_api void fplThreadSleep (const uint32_t milliseconds)
 Let the current thread sleep for the given amount of milliseconds. More...
 
fpl_platform_api bool fplThreadTerminate (fplThreadHandle *thread)
 Forces the given thread to stop and release all underlying resources. More...
 
fpl_platform_api bool fplThreadWaitForAll (fplThreadHandle **threads, const size_t count, const size_t stride, const fplTimeoutValue timeout)
 Wait until all given threads are done running or the given timeout has been reached. More...
 
fpl_platform_api bool fplThreadWaitForAny (fplThreadHandle **threads, const size_t count, const size_t stride, const fplTimeoutValue timeout)
 Wait until one of the given threads is done running or the given timeout has been reached. More...
 
fpl_platform_api bool fplThreadWaitForOne (fplThreadHandle *thread, const fplTimeoutValue timeout)
 Wait until the given thread is done running or the given timeout has been reached. More...
 
fpl_platform_api bool fplThreadYield ()
 Let the current thread yield execution to another thread that is ready to run on this core. More...
 

Detailed Description

This category contains functions/types for dealing with concurrent programming, such as threads, mutexes, conditions, etc.

Typedef Documentation

◆ fpl_run_thread_callback

typedef void() fpl_run_thread_callback(const fplThreadHandle *thread, void *data)

A callback to execute user code inside another thread.

Parameters
threadThe thread handle
dataThe user data pointer

Definition at line 4464 of file final_platform_layer.h.

◆ fplThreadHandle

Forward declared thread handle.

The thread handle structure.

Definition at line 4457 of file final_platform_layer.h.

Enumeration Type Documentation

◆ fplSignalValue

An enumeration of signal values.

Enumerator
fplSignalValue_Unset 

Value is unset.

fplSignalValue_Set 

Value is set.

Definition at line 4572 of file final_platform_layer.h.

◆ fplThreadPriority

Defines all possible thread priorities.

Enumerator
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 4430 of file final_platform_layer.h.

◆ fplThreadStates

An enumeration of thread states.

Enumerator
fplThreadState_Stopped 

Thread is stopped.

fplThreadState_Starting 

Thread is being started.

fplThreadState_Running 

Thread is still running.

fplThreadState_Stopping 

Thread is being stopped.

Definition at line 4415 of file final_platform_layer.h.

Function Documentation

◆ fplConditionBroadcast()

fpl_platform_api bool fplConditionBroadcast ( fplConditionVariable condition)

Wakes up all threads that wait on the given condition.

Parameters
conditionThe pointer to the fplConditionVariable structure
Returns
Returns true when the function succeeds, false otherwise.
See also
Send a Condition-Variable Broadcast to all waiting Threads

◆ fplConditionDestroy()

fpl_platform_api void fplConditionDestroy ( fplConditionVariable condition)

Releases the given condition and clears the structure to zero.

Parameters
conditionThe pointer to the fplConditionVariable structure
See also
Initialize a Condition-Variable

◆ fplConditionInit()

fpl_platform_api bool fplConditionInit ( fplConditionVariable condition)

Initialize s the given condition.

Parameters
conditionThe pointer to the fplConditionVariable structure
Returns
Returns true when initialization was successful, false otherwise.
Note
Use fplSignalDestroy() when you are done with this Condition Variable to release its resources.
See also
Initialize a Condition-Variable

◆ fplConditionSignal()

fpl_platform_api bool fplConditionSignal ( fplConditionVariable condition)

Wakes up one thread that waits on the given condition.

Parameters
conditionThe pointer to the fplConditionVariable structure
Returns
Returns true when the function succeeds, false otherwise.
See also
Send a Signal to a Condition-Variable to one waiting Thread

◆ fplConditionWait()

fpl_platform_api bool fplConditionWait ( fplConditionVariable condition,
fplMutexHandle mutex,
const fplTimeoutValue  timeout 
)

Sleeps on the given condition and releases the mutex when done.

Parameters
conditionThe pointer to the fplConditionVariable structure
mutexThe pointer to the mutex handle fplMutexHandle structure
timeoutThe number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE it will wait infinitely.
Returns
Returns true when the function succeeds, false otherwise.
See also
Waiting on a Condition-Variable

◆ fplGetCurrentThreadId()

fpl_platform_api uint32_t fplGetCurrentThreadId ( )

Gets the thread id for the current thread.

Returns
Returns the thread id for the current thread.

◆ fplGetMainThread()

const fpl_common_api fplThreadHandle* fplGetMainThread ( )

Gets the thread handle for the main thread.

Returns
Returns the immutable pointer to the fplThreadHandle .

◆ fplGetThreadPriority()

fpl_platform_api fplThreadPriority fplGetThreadPriority ( fplThreadHandle thread)

Retrieves the current thread priority from the OS from the given fplThreadHandle .

Parameters
threadThe pointer to the fplThreadHandle structure
Returns
Returns the current fplThreadPriority .

◆ fplGetThreadState()

fpl_common_api fplThreadState fplGetThreadState ( fplThreadHandle thread)

Gets the current thread state for the given thread.

Parameters
threadThe thread handle fplThreadHandle
Returns
Returns the current thread state fplThreadState for the given thread
See also
Query the Thread State

◆ fplMutexDestroy()

fpl_platform_api void fplMutexDestroy ( fplMutexHandle mutex)

Releases the given mutex and clears the structure to zero.

Parameters
mutexThe pointer to the fplMutexHandle structure
See also
Initialize a Mutex

◆ fplMutexInit()

fpl_platform_api bool fplMutexInit ( fplMutexHandle mutex)

Initializes the given mutex.

Parameters
mutexThe pointer to the fplMutexHandle structure
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

◆ fplMutexLock()

fpl_platform_api bool fplMutexLock ( fplMutexHandle mutex)

Locks the given mutex and blocks any other threads.

Parameters
mutexThe pointer to the fplMutexHandle structure
Returns
Returns true when the mutex was locked, false otherwise.
See also
Locking a Mutex

◆ fplMutexTryLock()

fpl_platform_api bool fplMutexTryLock ( fplMutexHandle mutex)

Tries to lock the given mutex without blocking other threads.

Parameters
mutexThe pointer to the fplMutexHandle structure
Returns
Returns true when the mutex was locked, false otherwise.
See also
Trying to lock a Mutex

◆ fplMutexUnlock()

fpl_platform_api bool fplMutexUnlock ( fplMutexHandle mutex)

Unlocks the given mutex.

Parameters
mutexThe pointer to the fplMutexHandle structure
Returns
Returns true when the mutex was unlocked, false otherwise.
See also
Unlocking a Mutex

◆ fplSemaphoreDestroy()

fpl_platform_api void fplSemaphoreDestroy ( fplSemaphoreHandle semaphore)

Releases the internal semaphore resources.

Parameters
semaphoreThe pointer to the fplSemaphoreHandle structure
Warning
Do not call this when a thread is still waiting on this semaphore
See also
Initialize a Semaphore

◆ fplSemaphoreInit()

fpl_platform_api bool fplSemaphoreInit ( fplSemaphoreHandle semaphore,
const uint32_t  initialValue 
)

Initializes the semaphore with the given initial value.

Parameters
semaphoreThe pointer to the fplSemaphoreHandle structure
initialValueThe initial value
Returns
Returns true when the semaphores got initialized, false otherwise.
See also
Initialize a Semaphore

◆ fplSemaphoreRelease()

fpl_platform_api bool fplSemaphoreRelease ( fplSemaphoreHandle semaphore)

Increments the semaphore value by one.

Parameters
semaphoreThe pointer to the fplSemaphoreHandle structure
Returns
Returns true when semaphore was incremented, false otherwise.
See also
Releasing the Semaphore

◆ fplSemaphoreTryWait()

fpl_platform_api bool fplSemaphoreTryWait ( fplSemaphoreHandle semaphore)

Tries to wait for the semaphore until it gets signaled or return immediately.

Parameters
semaphoreThe pointer to the fplSemaphoreHandle structure
Returns
Returns true when the semaphore got signaled, false otherwise.
Note
When a semaphore got signaled, the semaphore value is decreased by one.
See also
Trying to wait on a Semaphore

◆ fplSemaphoreValue()

fpl_platform_api int32_t fplSemaphoreValue ( fplSemaphoreHandle semaphore)

Gets the current semaphore value.

Parameters
semaphoreThe pointer to the fplSemaphoreHandle structure
Returns
Returns the current semaphore value
See also
Reading the Value from the Semaphore

◆ fplSemaphoreWait()

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
semaphoreThe pointer to the fplSemaphoreHandle structure
timeoutThe number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE it will wait infinitely.
Returns
Returns true when the semaphore got signaled, false otherwise.
Note
When a semaphore got signaled, the semaphore value is decreased by one.
See also
Waiting/Locking a Semaphore

◆ fplSetThreadPriority()

fpl_platform_api bool fplSetThreadPriority ( fplThreadHandle thread,
const fplThreadPriority  newPriority 
)

Changes the thread priority to the given one, for the given fplThreadHandle .

Parameters
threadThe pointer to the fplThreadHandle structure
newPriorityThe new fplThreadPriority for the given thread
Returns
Returns true when the priority was changed, false otherwise.

◆ fplSignalDestroy()

fpl_platform_api void fplSignalDestroy ( fplSignalHandle signal)

Releases the given signal and clears the structure to zero.

Parameters
signalThe pointer to the fplSignalHandle structure
See also
Initialize a Signal

◆ fplSignalInit()

fpl_platform_api bool fplSignalInit ( fplSignalHandle signal,
const fplSignalValue  initialValue 
)

Initializes the given signal.

Parameters
signalThe pointer to the fplSignalHandle structure
initialValueThe 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

◆ fplSignalReset()

fpl_platform_api bool fplSignalReset ( fplSignalHandle signal)

Resets the signal.

Parameters
signalThe pointer to the fplSignalHandle structure
Returns
Returns true when the signal was reset, false otherwise.
See also
Resetting a Signal

◆ fplSignalSet()

fpl_platform_api bool fplSignalSet ( fplSignalHandle signal)

Sets the signal and wakes up the given signal.

Parameters
signalThe pointer to the fplSignalHandle structure
Returns
Returns true when the signal was set and broadcasted or false otherwise.
See also
Setting a Signal

◆ fplSignalWaitForAll()

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 waked up.

Parameters
signalsThe pointer to the first fplSignalHandle pointer
countThe number of signals
strideThe size in bytes to the next signal handle. When this is set to zero, the array default is used.
timeoutThe number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE it will wait infinitely.
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

◆ fplSignalWaitForAny()

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
signalsThe pointer to the first fplSignalHandle pointer
countThe number of signals
strideThe size in bytes to the next signal handle. When this is set to zero, the array default is used.
timeoutThe number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE it will wait infinitely.
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

◆ fplSignalWaitForOne()

fpl_platform_api bool fplSignalWaitForOne ( fplSignalHandle signal,
const fplTimeoutValue  timeout 
)

Waits until the given signal is waked up.

Parameters
signalThe pointer to the fplSignalHandle structure
timeoutThe number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE it will wait infinitely.
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

◆ fplThreadCreate()

fpl_platform_api fplThreadHandle* fplThreadCreate ( fpl_run_thread_callback runFunc,
void *  data 
)

Creates and starts a thread and returns the handle to it.

Parameters
runFuncThe pointer to the fpl_run_thread_callback
dataThe user data pointer passed to the execution function callback
Returns
Returns a pointer to the fplThreadHandle structure or fpl_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

◆ fplThreadCreateWithParameters()

fpl_platform_api fplThreadHandle* fplThreadCreateWithParameters ( fplThreadParameters parameters)

Creates and starts a thread from the specified fplThreadParameters and returns the handle to it.

Parameters
parametersThe pointer to the fplThreadParameters
Returns
Returns a pointer to the fplThreadHandle structure or fpl_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.

◆ fplThreadSleep()

fpl_platform_api void fplThreadSleep ( const uint32_t  milliseconds)

Let the current thread sleep for the given amount of milliseconds.

Parameters
millisecondsNumber 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.

◆ fplThreadTerminate()

fpl_platform_api bool fplThreadTerminate ( fplThreadHandle thread)

Forces the given thread to stop and release all underlying resources.

Parameters
threadThe pointer to the fplThreadHandle structure
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.
Returns true when the threads were terminated, false otherwise.
See also
Terminate a thread

◆ fplThreadWaitForAll()

fpl_platform_api bool fplThreadWaitForAll ( fplThreadHandle **  threads,
const size_t  count,
const size_t  stride,
const fplTimeoutValue  timeout 
)

Wait until all given threads are done running or the given timeout has been reached.

Parameters
threadsThe pointer to the first fplThreadHandle pointer
countThe number of threads
strideThe size in bytes to the next thread handle. When this is set to zero, the array default is used.
timeoutThe number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE it will wait infinitely.
Returns
Returns true when all threads complete or when the timeout has been reached, false otherwise.
See also
Wait for all Threads to Exit

◆ fplThreadWaitForAny()

fpl_platform_api bool fplThreadWaitForAny ( fplThreadHandle **  threads,
const size_t  count,
const size_t  stride,
const fplTimeoutValue  timeout 
)

Wait until one of the given threads is done running or the given timeout has been reached.

Parameters
threadsThe pointer to the first fplThreadHandle pointer
countThe number of threads
strideThe size in bytes to the next thread handle. When this is set to zero, the array default is used.
timeoutThe number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE it will wait infinitely.
Returns
Returns true when one thread completes or when the timeout has been reached, false otherwise.
See also
Wait for any Thread to Exit

◆ fplThreadWaitForOne()

fpl_platform_api bool fplThreadWaitForOne ( fplThreadHandle thread,
const fplTimeoutValue  timeout 
)

Wait until the given thread is done running or the given timeout has been reached.

Parameters
threadThe pointer to the fplThreadHandle structure
timeoutThe number of milliseconds to wait. When this is set to FPL_TIMEOUT_INFINITE it will wait infinitely.
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

◆ fplThreadYield()

fpl_platform_api bool fplThreadYield ( )

Let the current thread yield execution to another thread that is ready to run on this core.

Returns
Returns true when the functions succeed, false otherwise.