RTEMS
coretod.c
Go to the documentation of this file.
1 
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 #ifdef HAVE_CONFIG_H
18 #include "config.h"
19 #endif
20 
21 #include <rtems/score/todimpl.h>
22 #include <rtems/score/apimutex.h>
23 
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
TOD control.
Definition: todimpl.h:135
bool _API_Mutex_Is_owner(const API_Mutex_Control *mutex)
Checks if the specified API mutex is owned by the executing thread.
void _API_Mutex_Lock(API_Mutex_Control *mutex)
Acquires the specified API mutex.
Definition: apimutexlock.c:25
TOD_Control _TOD
TOD Management information.
Definition: coretod.c:24
API Mutex Handler API.
#define API_MUTEX_INITIALIZER(name)
Statically initialize an API mutex.
Definition: apimutex.h:58
Time of Day Handler API.
void _API_Mutex_Unlock(API_Mutex_Control *mutex)
Releases the specified API mutex.
void _TOD_Unlock(void)
Unlocks the time of day mutex.
Definition: coretod.c:33
Control block used to manage each API mutex.
Definition: apimutex.h:42
void _TOD_Lock(void)
Locks the time of day mutex.
Definition: coretod.c:28