Change `Mutex::unlock()` function definition - void return value

This is done for consistency with the new version of `Mutex::lock()` member function which does not return status.
pull/7423/head
Przemyslaw Stekiel 2018-07-06 14:03:26 +02:00
parent f65bba9a23
commit c693eb512a
2 changed files with 8 additions and 9 deletions

View File

@ -108,10 +108,13 @@ bool Mutex::trylock_until(uint64_t millisec)
} }
} }
osStatus Mutex::unlock() void Mutex::unlock()
{ {
_count--; _count--;
return osMutexRelease(_id);
osStatus status = osMutexRelease(_id);
MBED_ASSERT(status == osOK);
} }
osThreadId Mutex::get_owner() osThreadId Mutex::get_owner()

View File

@ -135,16 +135,12 @@ public:
*/ */
bool trylock_until(uint64_t millisec); bool trylock_until(uint64_t millisec);
/** Unlock the mutex that has previously been locked by the same thread /**
@return status code that indicates the execution status of the function: Unlock the mutex that has previously been locked by the same thread
@a osOK the mutex has been released.
@a osErrorParameter internal error.
@a osErrorResource the mutex was not locked or the current thread wasn't the owner.
@a osErrorISR this function cannot be called from the interrupt service routine.
@note You cannot call this function from ISR context. @note You cannot call this function from ISR context.
*/ */
osStatus unlock(); void unlock();
/** Get the owner the this mutex /** Get the owner the this mutex
@return the current owner of this mutex. @return the current owner of this mutex.