O2S C Library 1.8.2
Provide high-level data-structures and other fundamental tools for C projects
Loading...
Searching...
No Matches
mutex.h
Go to the documentation of this file.
1#pragma once
2
3/* ************************************************************************** */
4/* ____ _ _____ ____ _ _ _ _____ _ _ ____ ____ */
5/* / ___| / \ | ___| _ \ / \ | \ | | |_ _| || | | _ \/ ___| */
6/* \___ \ / _ \ | |_ | |_) | / _ \ | \| | | | | || |_| | | \___ \ */
7/* ___) / ___ \| _| | _ < / ___ \| |\ | | | |__ _| |_| |___) | */
8/* |____/_/ \_|_| |_| \_/_/ \_|_| \_| |_| |_| |____/|____/ */
9/* */
16/* ************************************************************************** */
17
18#include <pthread.h> // pthread_mutex_t
19
20pthread_mutex_t* o2s_mutex_lock(pthread_mutex_t* mutex);
21void o2s_mutex_unlock(pthread_mutex_t* const* mutex);
22
38#define O2sLockGuard __attribute__((cleanup(o2s_mutex_unlock))) pthread_mutex_t*
void o2s_mutex_unlock(pthread_mutex_t *const *mutex)
Unlock the mutex, logging any error.
Definition mutex.c:35
pthread_mutex_t * o2s_mutex_lock(pthread_mutex_t *mutex)
Lock the mutex, logging any error.
Definition mutex.c:25