Xenomai  3.0.8
mutex.h
1 /*
2  * Written by Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17  */
18 #ifndef _COBALT_UAPI_MUTEX_H
19 #define _COBALT_UAPI_MUTEX_H
20 
21 #include <cobalt/uapi/kernel/types.h>
22 
23 #define COBALT_MUTEX_MAGIC 0x86860303
24 
25 struct cobalt_mutex_state {
26  atomic_t owner;
27  __u32 flags;
28 #define COBALT_MUTEX_COND_SIGNAL 0x00000001
29 #define COBALT_MUTEX_ERRORCHECK 0x00000002
30 };
31 
32 union cobalt_mutex_union {
33  pthread_mutex_t native_mutex;
34  struct cobalt_mutex_shadow {
35  __u32 magic;
36  __u32 lockcnt;
37  __u32 state_offset;
38  xnhandle_t handle;
39  struct cobalt_mutexattr attr;
40  } shadow_mutex;
41 };
42 
43 #endif /* !_COBALT_UAPI_MUTEX_H */
Copyright © 2011 Gilles Chanteperdrix gilles.chanteperdrix@xenomai.org.
Definition: atomic.h:24