[PATCH] c-users: Add rtems_*mutex_try_lock

Christian MAUDERER christian.mauderer at embedded-brains.de
Fri May 28 06:21:35 UTC 2021


Thanks for the review.

Am 28.05.21 um 04:31 schrieb Gedare Bloom:
> looks alright to me.
> 
> On Wed, May 26, 2021 at 3:34 AM Christian Mauderer
> <christian.mauderer at embedded-brains.de> wrote:
>>
>> ---
>>   c-user/self_contained_objects.rst | 35 +++++++++++++++++++++++++++++++
>>   1 file changed, 35 insertions(+)
>>
>> diff --git a/c-user/self_contained_objects.rst b/c-user/self_contained_objects.rst
>> index 0be1423..3351b98 100644
>> --- a/c-user/self_contained_objects.rst
>> +++ b/c-user/self_contained_objects.rst
>> @@ -132,6 +132,10 @@ copies of the object in calls to
>>
>>   * :c:func:`rtems_recursive_mutex_lock`,
>>
>> +* :c:func:`rtems_mutex_try_lock`,
>> +
>> +* :c:func:`rtems_recursive_mutex_try_lock`,
>> +
>>   * :c:func:`rtems_mutex_unlock`,
>>
>>   * :c:func:`rtems_recursive_mutex_unlock`,
>> @@ -262,6 +266,37 @@ NOTES:
>>
>>       \clearpage
>>
>> +Try to lock the mutex
>> +---------------------
>> +
>> +CALLING SEQUENCE:
>> +    .. code-block:: c
>> +
>> +        void rtems_mutex_try_lock(
>> +          rtems_mutex *mutex
>> +        );
>> +
>> +        void rtems_recursive_mutex_try_lock(
>> +          rtems_recursive_mutex *mutex
>> +        );
>> +
>> +DESCRIPTION:
>> +    Tries to lock the ``mutex``. In case the mutex is not locked, it will be
>> +    locked and the function returns with a return value of ``0``. If the mutex
>> +    is already locked, the function will return with a value of ``EBUSY``.
>> +
>> +NOTES:
>> +    This function must be called from thread context with interrupts enabled.
>> +
>> +    For recursively locking a mutex, please also see the notes for
>> +    :c:func:`rtems_mutex_lock` and :c:func:`rtems_recursive_mutex_lock`.
>> +
>> +    Each mutex lock operation must have a corresponding unlock operation.
>> +
>> +.. raw:: latex
>> +
>> +    \clearpage
>> +
>>   Unlock the mutex
>>   ----------------
>>
>> --
>> 2.26.2
>>
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel

-- 
--------------------------------------------
embedded brains GmbH
Herr Christian MAUDERER
Dornierstr. 4
82178 Puchheim
Germany
email: christian.mauderer at embedded-brains.de
phone: +49-89-18 94 741 - 18
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list