18#ifndef __L4UTIL_LOCK_H__
19#define __L4UTIL_LOCK_H__
21#include <l4/sys/thread.h>
29L4_INLINE int l4_simple_try_lock(l4util_simple_lock_t *lock);
30L4_INLINE void l4_simple_unlock(l4util_simple_lock_t *lock);
31L4_INLINE int l4_simple_lock_locked(l4util_simple_lock_t *lock);
32L4_INLINE void l4_simple_lock_solid(
register l4util_simple_lock_t *p);
33L4_INLINE void l4_simple_lock(l4util_simple_lock_t * lock);
36l4_simple_try_lock(l4util_simple_lock_t *lock)
42l4_simple_unlock(l4util_simple_lock_t *lock)
48l4_simple_lock_locked(l4util_simple_lock_t *lock)
50 return (*lock == 0) ? 0 : 1;
54l4_simple_lock_solid(
register l4util_simple_lock_t *p)
56 while (l4_simple_lock_locked(p) || !l4_simple_try_lock(p))
61l4_simple_lock(l4util_simple_lock_t * lock)
63 if (!l4_simple_try_lock(lock))
64 l4_simple_lock_solid(lock);
L4 compiler related defines.
unsigned int l4_uint32_t
Unsigned 32bit value.
@ L4_INVALID_CAP
Invalid capability selector.
l4_msgtag_t l4_thread_switch(l4_cap_idx_t to_thread) L4_NOTHROW
Switch to another thread (and donate the remaining time slice).
#define L4_INLINE
L4 Inline function attribute.
#define EXTERN_C_BEGIN
Start section with C types and functions.
#define EXTERN_C_END
End section with C types and functions.
l4_uint32_t l4util_xchg32(volatile l4_uint32_t *dest, l4_uint32_t val)
Atomic exchange (32 bit version)
atomic operations header and generic implementations