FastSemaphore Functions
The following functions are available to initialize and use a FastSemaphore.
- RtInitializeFastSemaphore creates a FastSemaphore.
- RtAcquireFastSemaphore places the thread in a busy-wait state until the FastSemaphore is released.
- RtGetCountFastSemaphore returns the number of threads waiting for the FastSemaphore.
- RtReleaseAllFastSemaphore releases all threads waiting for the FastSemaphore.
- RtReleaseFastSemaphore releases a specified count of threads waiting for the FastSemaphore.
Using RtInitializeFastSemaphore
A thread uses the RtInitializeFastSemaphore function to initialize the RTFAST_SEMAPHORE structure variable. The RTFAST_SEMAPHORE structure must have been created before being passed into the RtInitializeFastSemaphore function.
Using RtAcquireFastSemaphore
A thread uses the RtAcquireFastSemaphore function to place the current thread in a busy-wait state until the FastSemaphore is released.
Using RtGetCountFastSemaphore
A thread uses the RtGetCountFastSemaphore function to return the number of threads waiting on this FastSemaphore.
Using RtReleaseAllFastSemaphore
A thread uses the RtReleaseAllFastSemaphore function to release all threads waiting on the FastSemaphore. The RtReleaseAllFastSemaphore function ensures that all waiting threads enter the ready-to-run state.
Using RtReleaseFastSemaphore
A thread uses the RtReleaseFastSemaphore function to release the specified count of threads waiting on the FastSemaphore.