5
Last change
on this file since 21275b58 was
6c2b8a4b,
checked in by Sebastian Huber <sebastian.huber@…>, on 11/29/17 at 05:23:27
|
score: Use self-contained API mutex
Use a self-contained recursive mutex for API_Mutex_Control. The API
mutexes are protected against asynchronous thread cancellation.
Add dedicated mutexes for libatomic and TOD.
Close #2629.
Close #2630.
|
-
Property mode set to
100644
|
File size:
922 bytes
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Releases the Specified API Mutex |
---|
5 | * |
---|
6 | * @ingroup ScoreAPIMutex |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * COPYRIGHT (c) 1989-2007. |
---|
11 | * On-Line Applications Research Corporation (OAR). |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.org/license/LICENSE. |
---|
16 | */ |
---|
17 | |
---|
18 | #if HAVE_CONFIG_H |
---|
19 | #include "config.h" |
---|
20 | #endif |
---|
21 | |
---|
22 | #include <rtems/score/apimutex.h> |
---|
23 | #include <rtems/score/threadimpl.h> |
---|
24 | |
---|
25 | void _API_Mutex_Unlock( API_Mutex_Control *the_mutex ) |
---|
26 | { |
---|
27 | Thread_Life_state previous_thread_life_state; |
---|
28 | bool restore_thread_life_protection; |
---|
29 | |
---|
30 | previous_thread_life_state = the_mutex->previous_thread_life_state; |
---|
31 | restore_thread_life_protection = the_mutex->Mutex._nest_level == 0; |
---|
32 | |
---|
33 | _Mutex_recursive_Release( &the_mutex->Mutex ); |
---|
34 | |
---|
35 | if ( restore_thread_life_protection ) { |
---|
36 | _Thread_Set_life_protection( previous_thread_life_state ); |
---|
37 | } |
---|
38 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.