Xenomai  3.1
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  __u32 ceiling;
31 };
32 
33 union cobalt_mutex_union {
34  pthread_mutex_t native_mutex;
35  struct cobalt_mutex_shadow {
36  __u32 magic;
37  __u32 lockcnt;
38  __u32 state_offset;
39  xnhandle_t handle;
40  struct cobalt_mutexattr attr;
41  } shadow_mutex;
42 };
43 
44 #endif /* !_COBALT_UAPI_MUTEX_H */
Copyright © 2011 Gilles Chanteperdrix gilles.chanteperdrix@xenomai.org.
Definition: atomic.h:24