39 char name[XNOBJECT_NAME_LEN];
46 typedef struct rt_mutex_placeholder {
50 #ifdef CONFIG_XENO_FASTSYNCH
51 xnarch_atomic_t *fastlock;
56 } RT_MUTEX_PLACEHOLDER;
58 #if (defined(__KERNEL__) || defined(__XENO_SIM__)) && !defined(DOXYGEN_CPP)
60 #include <nucleus/synch.h>
63 #define XENO_MUTEX_MAGIC 0x55550505
65 #define RT_MUTEX_EXPORTED XNSYNCH_SPARE0
67 typedef struct __rt_mutex {
77 char name[XNOBJECT_NAME_LEN];
79 #ifdef CONFIG_XENO_OPT_PERVASIVE
85 #define rlink2mutex(ln) container_of(ln, RT_MUTEX, rlink)
95 #ifdef CONFIG_XENO_OPT_NATIVE_MUTEX
97 int __native_mutex_pkg_init(
void);
99 void __native_mutex_pkg_cleanup(
void);
101 static inline void __native_mutex_flush_rq(xnqueue_t *rq)
103 xeno_flush_rq(RT_MUTEX, rq, mutex);
106 int rt_mutex_acquire_inner(RT_MUTEX *mutex, RTIME timeout,
107 xntmode_t timeout_mode);
111 #define __native_mutex_pkg_init() ({ 0; })
112 #define __native_mutex_pkg_cleanup() do { } while(0)
113 #define __native_mutex_flush_rq(rq) do { } while(0)
123 typedef RT_MUTEX_PLACEHOLDER RT_MUTEX;
136 mutex->opaque = XN_NO_HANDLE;
150 int rt_mutex_create_inner(RT_MUTEX *mutex,
const char *name,
int global);
int rt_mutex_delete(RT_MUTEX *mutex)
Delete a mutex.
Definition: mutex.c:67
int rt_mutex_bind(RT_MUTEX *mutex, const char *name, RTIME timeout)
Bind to a mutex.
Definition: mutex.c:48
int rt_mutex_create(RT_MUTEX *mutex, const char *name)
Create a mutex.
Definition: mutex.c:29
int rt_mutex_release(RT_MUTEX *mutex)
Unlock mutex.
Definition: mutex.c:156
static int rt_mutex_unbind(RT_MUTEX *mutex)
Unbind from a mutex.
Definition: mutex.h:133
int nwaiters
Number of pending tasks.
Definition: mutex.h:37
Structure containing mutex information useful to users.
Definition: mutex.h:33
int locked
0 if mutex is locked.
Definition: mutex.h:35
This file is part of the Xenomai project.
int rt_mutex_acquire_until(RT_MUTEX *mutex, RTIME timeout)
Acquire a mutex (with absolute timeout date).
Definition: mutex.c:151
int rt_mutex_inquire(RT_MUTEX *mutex, RT_MUTEX_INFO *info)
Inquire about a mutex.
Definition: mutex.c:188
int rt_mutex_acquire(RT_MUTEX *mutex, RTIME timeout)
Acquire a mutex.
Definition: mutex.c:146
char owner[XNOBJECT_NAME_LEN]
Symbolic name of the current owner, empty if unlocked.
Definition: mutex.h:41
struct rt_mutex_info RT_MUTEX_INFO
Structure containing mutex information useful to users.
char name[XNOBJECT_NAME_LEN]
Symbolic name.
Definition: mutex.h:39
This file is part of the Xenomai project.