RTEMS
apimutex.h
Go to the documentation of this file.
1 
9 /*
10  * COPYRIGHT (c) 1989-2008.
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 #ifndef _RTEMS_SCORE_APIMUTEX_H
19 #define _RTEMS_SCORE_APIMUTEX_H
20 
21 #include <rtems/score/thread.h>
22 
23 #include <sys/lock.h>
24 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
42 typedef struct {
46  struct _Mutex_recursive_Control Mutex;
47 
54 
58 #define API_MUTEX_INITIALIZER( name ) \
59  { _MUTEX_RECURSIVE_NAMED_INITIALIZER( name ), 0 }
60 
66 void _API_Mutex_Lock( API_Mutex_Control *mutex );
67 
74 
80 bool _API_Mutex_Is_owner( const API_Mutex_Control *mutex );
81 
98 void _RTEMS_Lock_allocator( void );
99 
100 void _RTEMS_Unlock_allocator( void );
101 
102 bool _RTEMS_Allocator_is_owner( void );
103 
106 #ifdef __cplusplus
107 }
108 #endif
109 
110 #endif
111 /* end of include file */
Thread_Life_state
Thread life states.
Definition: thread.h:672
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
void _API_Mutex_Unlock(API_Mutex_Control *mutex)
Releases the specified API mutex.
Thread_Life_state previous_thread_life_state
The thread life protection state before the outer-most mutex obtain.
Definition: apimutex.h:52
Control block used to manage each API mutex.
Definition: apimutex.h:42
Constants and Structures Related with the Thread Control Block.