7#ifndef ZEPHYR_INCLUDE_SYS_MUTEX_H_
8#define ZEPHYR_INCLUDE_SYS_MUTEX_H_
27#ifdef CONFIG_USERSPACE
38#ifdef CONFIG_SYS_MUTEX_IMPL_K_MUTEX
40#elif defined(CONFIG_SYS_MUTEX_IMPL_FUTEX)
47#ifdef CONFIG_SYS_MUTEX_IMPL_K_MUTEX
50__syscall
int z_sys_mutex_kernel_unlock(
struct sys_mutex *mutex);
52#include <zephyr/syscalls/mutex.h>
72#if defined(CONFIG_SYS_MUTEX_IMPL_FUTEX)
73#define SYS_MUTEX_DEFINE(name) struct sys_mutex name = {.futex = {0}, .counter = 0}
75#define SYS_MUTEX_DEFINE(name) struct sys_mutex name
149#define SYS_MUTEX_DEFINE(name) \
150 struct sys_mutex name = { \
151 .kernel_mutex = Z_MUTEX_INITIALIZER(name.kernel_mutex) \
Header file for the Atomic operations API.
long atomic_t
Atomic integer variable.
Definition atomic_types.h:34
int k_mutex_unlock(struct k_mutex *mutex)
Unlock a mutex.
int k_mutex_init(struct k_mutex *mutex)
Initialize a mutex.
int k_mutex_lock(struct k_mutex *mutex, k_timeout_t timeout)
Lock a mutex.
void sys_mutex_init(struct sys_mutex *mutex)
Initialize a mutex.
int sys_mutex_lock(struct sys_mutex *mutex, k_timeout_t timeout)
Lock a mutex.
int sys_mutex_unlock(struct sys_mutex *mutex)
Unlock a mutex.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
futex structure
Definition kernel.h:2638
Kernel mutex structure.
Definition kernel.h:3514
Kernel timeout type.
Definition clock.h:65
Userspace mutex.
Definition mutex.h:36