FF_PendSemaphore()
From FullFAT
Waits on the specified semaphore or mutex object, blocking execution of the current thread until the semaphore or mutex object becomes available.
This function must be written by the developer to provide thread-safe integration with their platform.
Contents |
Prototype
void FF_PendSemaphore(void *pSemaphore);
Back to API.
The provided pSemaphore object must be cast to the type appropriate for your platform and then passed to the platforms pend semaphore function.
Example
On windows this is done with the following code:
#include <windows.h> void FF_PendSemaphore(void *pSemaphore) { // Call your OS's PendSemaphore with the provided pSemaphore pointer. HANDLE hSem = (HANDLE) pSemaphore; WaitForSingleObject(hSem, INFINITE); }
Back to API.
Or Analog Devices VDK Kernel:
#include <VDK.h> void FF_PendSemaphore(void *pSemaphore) { // Call your OS's PendSemaphore with the provided pSemaphore pointer. // // This should block indefinitely until the Semaphore // becomes available. (No timeout!) // If your OS doesn't do it for you, you should sleep // this thread until the Semaphore is available. VDK_SemaphoreID *mysem = (VDK_SemaphoreID *) pSemaphore; VDK_PendSemaphore(*mysem, 0); }
Back to API.
NOTE
Examples for Linux are documented in the demo projects, and will be added here shortly.
These functions should NEVER be called by the developer! FullFAT will call you!
Back to API.
See Also
- FF_CreateSemaphore()
- FF_DestroySemaphore()
- FF_PendSemaphore()
- FF_ReleaseSemaphore()
- FF_Yield()
- FF_Sleep()
- FF_GetSystemTime()
- ff_config.h
- ff_types.h

