SYS_MutexLock Function
C
bool SYS_MutexLock(SYS_Mutex_t *const mutex, SYS_MutexOwner_t *const owner);
Description
Makes the asynchronous request to lock the mutex.
\ingroup sys
DECLARE_MUTEX(aesMutex); SYS_MutexOwner_t sspOwnerOfAesMutex = {.SYS_MutexLockConf = callback}; ... if (!SYS_MutexLock(&aesMutex, &sspOwnerOfAesMutex)) return; // Wait the callback function. // Work with the resource which is locked by the mutex.
Parameters
Param | Description |
---|---|
mutex | the pointer to created mutex. |
owner | the pointer to owner's structure. Memory for this structure is allocated by the owner. Memory can't be reused by owner the mutex is locked by the owner. |
Returns
true - the locking operation finishes successfuly otherwise
false - the operation was postponed. The SYS_MutexLockConf() will be called when the mutex is locked for this owner.