Remove Mutex deprecated API

pull/12596/head
Rajkumar Kanagaraj 2020-03-06 09:39:30 -08:00
parent aa6fd58804
commit 3674bd1842
4 changed files with 2 additions and 38 deletions

View File

@ -27,7 +27,7 @@ rtos::Mutex::~Mutex()
return;
}
osStatus rtos::Mutex::lock(uint32_t millisec)
osStatus rtos::Mutex::lock()
{
return osOK;
}

View File

@ -29,7 +29,7 @@ public:
Mutex(const char *name);
osStatus lock(uint32_t millisec = osWaitForever);
osStatus lock();
bool trylock();

View File

@ -97,24 +97,6 @@ public:
void lock(); // Value return backwards compatibility not required for non-RTOS
#endif
/**
Wait until a Mutex becomes available.
@deprecated Do not use this function. This function has been replaced with lock(), trylock() and trylock_for() functions.
@param millisec timeout value.
@return status code that indicates the execution status of the function:
@a osOK the mutex has been obtained.
@a osErrorTimeout the mutex could not be obtained in the given time.
@a osErrorResource the mutex could not be obtained when no timeout was specified.
@note You cannot call this function from ISR context.
@note This function treats RTOS errors as fatal system errors, so it can only return osOK or
osErrorResource in case when millisec is 0 or osErrorTimeout if millisec is not osWaitForever.
*/
MBED_DEPRECATED_SINCE("mbed-os-5.10.0", "Replaced with lock(), trylock() and trylock_for() functions")
osStatus lock(uint32_t millisec);
/** Try to lock the mutex, and return immediately
@return true if the mutex was acquired, false otherwise.
@note equivalent to trylock_for(0)

View File

@ -71,24 +71,6 @@ osStatus Mutex::lock(void)
return osOK;
}
osStatus Mutex::lock(uint32_t millisec)
{
osStatus status = osMutexAcquire(_id, millisec);
if (osOK == status) {
_count++;
}
bool success = (status == osOK ||
(status == osErrorResource && millisec == 0) ||
(status == osErrorTimeout && millisec != osWaitForever));
if (!success && !mbed_get_error_in_progress()) {
MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_KERNEL, MBED_ERROR_CODE_MUTEX_LOCK_FAILED), "Mutex lock failed", status);
}
return status;
}
bool Mutex::trylock()
{
return trylock_for(0);