Commit Graph

13 Commits (164fee0e61ad770bda58f89eee21e1364b0cb23a)

Author SHA1 Message Date
Przemyslaw Stekiel fba9c4bc57 Address review comments.
Perform the following changes:
- change definition of `void Mutex::lock(void)` to `osStatus Mutex::lock(void)`.
- change definition of `void Mutex::unlock()` to `osStatus Mutex::unlock()`.
- use MBED_ERROR1 macro to check the lock/unlock operation status.
- add notes in the description of lock/unlock functions: "This function asserts status of the lock/unlock operation (will not return in case of failure). Use of the return value is deprecated, as the return is expected to become void in the future.".
- modify/add description of the return value.
- remove reference to Mbed 6.
- make `lock(millisec)` deprecated in favour of lock(), trylock() and trylock_for() functions.
2018-09-03 07:40:01 +02:00
Przemyslaw Stekiel c693eb512a 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.
2018-08-27 08:48:59 +02:00
Przemyslaw Stekiel 3decd510dc Fix codding style. 2018-08-27 08:47:16 +02:00
Przemyslaw Stekiel ca8070a482 Fix for issue #6872 - Mutex lock has possibility to fail at runtime (returning status flag)
Add assertions for statuses returned by osMutexAcquire().
Add void Mutex::lock(void) member function - lock function which does not return status and waits for the mutex forever.
Make osStatus Mutex::lock(uint32_t millisec=osWaitForever) member function deprecated in favour of bool Mutex::trylock_for(uint32_t millisec).
2018-08-27 08:47:16 +02:00
Kevin Bracey cd573a603f Add Mutex::trylock_until and trylock_for
Given the 64-bit timebase, add trylock_until to Mutex.

Naming is based on a combination of Mutex::trylock, Thread::wait_until,
and C++11 timed_mutex::try_lock_until.

pthreads and C11 use "timedlock", but that's not a good fit against our
existing trylock() and lock(timeout) - they have only absolute-time
waits, not relative.

To increase the similarity to C++11, add trylock_for - same parameters
as lock, but with the bool return value of trylock and trylock_until.

Add an assertion when convering status codes to booleans to check that
there are no non-timeout errors.
2018-01-29 15:26:41 +02:00
Martin Kojtal c45dd269f5
Merge pull request #3648 from c1728p9/condition_variable
Add ConditionVariable to mbed rtos
2017-11-09 16:38:02 +00:00
Kevin Bracey 130fffaf8b Shrink RTOS classes
Various RTOS classes were storing their CMSIS-RTOS creation attribute
structure as a member, when it's not required after construction. Reduce
memory by eliminating this member.
2017-11-03 15:22:22 +02:00
Russ Butler 0c4e50abb3 Add ConditionVariable to mbed rtos
Add the ConditionVariable class to mbed rtos to provide easier and
safer synchronization.
2017-11-02 21:02:27 -05:00
Russ Butler 96bd943ea2 RTX5: Enable priority inheritance and robust mode
Add the attribute flash to enable priority inheritance and robust mode.
The robust flag allows mutexes held by terminated threads to be
properly released.
2017-06-02 23:50:36 -05:00
Bartek Szatkowski 0064df1ce6 Add name parameter for C++ mutex wrapper 2017-05-30 18:55:55 +01:00
Bartek Szatkowski b793a3fb89 Update codebase for CMSIS5/RTX5
Update all of mbed-os to use RTX5.
2017-05-30 18:55:52 +01:00
Sam Grove 301b77c4b2 For drivers, events, hal, platform, rtos and mbed.h add one level of path to make sure specific and unique includes files are found. 2016-10-01 02:11:36 -05:00
Christopher Haster 2dd90bbe3c restructure - Restructured rtos directory 2016-09-30 19:18:09 -05:00