Data Structures | |
struct | _mutex |
Recursive mutex. More... | |
struct | _MUTEX |
Typedefs | |
typedef _MUTEX | MUTEX |
Recursive mutex type. | |
Functions | |
int | NutMutexDestroy (MUTEX *mutex) |
Free resources allocated for a mutex. | |
void | NutMutexInit (MUTEX *mutex) |
Create a mutex. | |
void | NutMutexLock (MUTEX *mutex) |
Lock a mutex. | |
int | NutMutexTrylock (MUTEX *mutex) |
Attempt to lock a mutex without blocking. | |
int | NutMutexUnlock (MUTEX *mutex) |
Unlock a mutex. |
int NutMutexDestroy | ( | MUTEX * | mutex | ) |
Free resources allocated for a mutex.
Return zero, if successful, otherwise the mutex is locked by another thread
void NutMutexInit | ( | MUTEX * | mutex | ) |
Create a mutex.
The type for the mutex is recursive
void NutMutexLock | ( | MUTEX * | mutex | ) |
Lock a mutex.
If the mutex is already locked by another thread, the thread will block until the mutex becomes available
int NutMutexTrylock | ( | MUTEX * | mutex | ) |
Attempt to lock a mutex without blocking.
Return zero, if successful, otherwise the mutex is already locked by another thread
int NutMutexUnlock | ( | MUTEX * | mutex | ) |
Unlock a mutex.
Return zero, if successful, otherwise the current thread does not hold a lock on mutex.