5
Last change
on this file since fce900b5 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:
781 bytes
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Initializes the Time of Day Handler |
---|
5 | * |
---|
6 | * @ingroup ScoreTOD |
---|
7 | */ |
---|
8 | |
---|
9 | /* COPYRIGHT (c) 1989-2014. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #if HAVE_CONFIG_H |
---|
18 | #include "config.h" |
---|
19 | #endif |
---|
20 | |
---|
21 | #include <rtems/score/todimpl.h> |
---|
22 | #include <rtems/score/apimutex.h> |
---|
23 | |
---|
24 | TOD_Control _TOD; |
---|
25 | |
---|
26 | static API_Mutex_Control _TOD_Mutex = API_MUTEX_INITIALIZER( "_TOD" ); |
---|
27 | |
---|
28 | void _TOD_Lock( void ) |
---|
29 | { |
---|
30 | _API_Mutex_Lock( &_TOD_Mutex ); |
---|
31 | } |
---|
32 | |
---|
33 | void _TOD_Unlock( void ) |
---|
34 | { |
---|
35 | _API_Mutex_Unlock( &_TOD_Mutex ); |
---|
36 | } |
---|
37 | |
---|
38 | #if defined(RTEMS_DEBUG) |
---|
39 | bool _TOD_Is_owner( void ) |
---|
40 | { |
---|
41 | return _API_Mutex_Is_owner( &_TOD_Mutex ); |
---|
42 | } |
---|
43 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.