Neonode zForce(TM) SDK
|
Overrides for OS Functions. More...
#include <OsAbstractionLayer.h>
Public Attributes | |
void *(* | Malloc )(size_t size) |
Allocate memory area. The memory area is not nulled. More... | |
void(* | Free )(void *memoryPointer) |
Free previously allocated memory area. More... | |
void *(* | Realloc )(void *memoryPointer, size_t size) |
Reallocate previously allocated memory area with a new size. More... | |
bool(* | InitializeMutex )(zForceMutex **zForceMutex) |
Initialize Mutex. More... | |
bool(* | LockMutex )(zForceMutex *zForceMutex) |
Lock Mutex. More... | |
bool(* | UnlockMutex )(zForceMutex *zForceMutex) |
Unlock Mutex. More... | |
bool(* | DestroyMutex )(zForceMutex *zForceMutex) |
Destroy Mutex. More... | |
bool(* | InitializeSemaphore )(zForceSemaphore **zForceSemaphore, uint32_t initialValue) |
Initialize Semaphore. More... | |
bool(* | WaitForSemaphore )(zForceSemaphore *zForceSemaphore, uint32_t timeoutMs) |
Wait for Semaphore. More... | |
bool(* | IncrementSemaphore )(zForceSemaphore *zForceSemaphore) |
Increment Semaphore. More... | |
bool(* | DestroySemaphore )(zForceSemaphore *zForceSemaphore) |
Destroy Semaphore. More... | |
uint64_t(* | GetTimeMilliSeconds )(void) |
Get time in MilliSeconds. More... | |
bool(* | CreateThread )(zForceThread **zForceThread, void(*entryPoint)(void *), void *arguments) |
Create Thread and run it. More... | |
bool(* | WaitForThreadExit )(zForceThread *zForceThread) |
Wait for Thread to exit. More... | |
void(* | Sleep )(uint32_t milliSeconds) |
Sleep for a specified amount of MilliSeconds. More... | |
Overrides for OS Functions.
bool( * OsAbstractionLayer::CreateThread) (zForceThread **zForceThread, void(*entryPoint)(void *), void *arguments) |
Create Thread and run it.
Create Thread and run it.
On failure, errno is set.
[out] | zForceThread | Pointer to zForceThread pointer. |
entryPoint | The entrypoint of the code to run. | |
arguments | Pointer to arguments passed to the thread. |
bool( * OsAbstractionLayer::DestroyMutex) (zForceMutex *zForceMutex) |
Destroy Mutex.
Destroy Mutex.
On failure, errno is set.
zForceMutex | Pointer to zForceMutex instance. |
bool( * OsAbstractionLayer::DestroySemaphore) (zForceSemaphore *zForceSemaphore) |
Destroy Semaphore.
Destroy Semaphore. Regardless of return code, the Semaphore should no longer be used.
On failure, errno is set.
zForceSemaphore | Semaphore to wait for. |
void( * OsAbstractionLayer::Free) (void *memoryPointer) |
Free previously allocated memory area.
Free previously allocated memory area.
memoryPointer | Pointer to memory area to free. |
uint64_t( * OsAbstractionLayer::GetTimeMilliSeconds) (void) |
Get time in MilliSeconds.
The only requirement on this time is that it is a time that does not change according to timezone changes or daylight time changes. There is no requirement on this being number of milliseconds since some specified time in history.
bool( * OsAbstractionLayer::IncrementSemaphore) (zForceSemaphore *zForceSemaphore) |
Increment Semaphore.
Increment Semaphore by 1.
On failure, errno is set.
zForceSemaphore | Semaphore to increment. |
bool( * OsAbstractionLayer::InitializeMutex) (zForceMutex **zForceMutex) |
Initialize Mutex.
Initialize Mutex.
On failure, errno is set.
[out] | zForceMutex | Pointer to a zForceMutex pointer. |
bool( * OsAbstractionLayer::InitializeSemaphore) (zForceSemaphore **zForceSemaphore, uint32_t initialValue) |
Initialize Semaphore.
Initialize Semaphore and set it to initialValue. The initial value is 0 for blocking and positive value for not currently blocking regardless of underlying implementation. For example for a queue, an initial value of 0 is desirable as the queue is empty initially.
On failure, errno is set.
[out] | zForceSemaphore | Pointer to zForceSemaphore pointer. |
initialValue | Initial value to set the Semaphore to. |
bool( * OsAbstractionLayer::LockMutex) (zForceMutex *zForceMutex) |
Lock Mutex.
Lock Mutex.
On failure, errno is set.
zForceMutex | Pointer to zForceMutex instance. |
void*( * OsAbstractionLayer::Malloc) (size_t size) |
Allocate memory area. The memory area is not nulled.
Allocate memory area. The memory area is not nulled.
On failure, errno is set.
size | Size of the requested memory area in bytes. |
void*( * OsAbstractionLayer::Realloc) (void *memoryPointer, size_t size) |
Reallocate previously allocated memory area with a new size.
Reallocate previously allocated memory area with a new size.
memoryPointer | Pointer to memory area or NULL to allocate a new one. |
size | Size of the new area. |
void( * OsAbstractionLayer::Sleep) (uint32_t milliSeconds) |
Sleep for a specified amount of MilliSeconds.
Suspends the execution of the current thread for the specified amount of MilliSeconds.
milliSeconds | Amount of MilliSeconds to Sleep. |
bool( * OsAbstractionLayer::UnlockMutex) (zForceMutex *zForceMutex) |
Unlock Mutex.
Unlock Mutex.
On failure, errno is set.
zForceMutex | Pointer to zForceMutex instance. |
bool( * OsAbstractionLayer::WaitForSemaphore) (zForceSemaphore *zForceSemaphore, uint32_t timeoutMs) |
Wait for Semaphore.
Wait for Semaphore. Blocks until count is incremented. No guarantee of order if multiple threads are waiting for the same Semaphore.
On failure, errno is set.
zForceSemaphore | Semaphore to wait for. |
bool( * OsAbstractionLayer::WaitForThreadExit) (zForceThread *zForceThread) |
Wait for Thread to exit.
Waits for Thread to exit. This function should normally never be called other than internally in the library. Blocks until Thread has exited, possibly forever.
On failure, errno is set.
zForceThread | zForceThread to wait for. |