From b945eafa126d6a17aa8826a405df7d5d4d999008 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Wed, 31 Mar 2010 17:26:21 +0200 Subject: Shared memory segment manager in userland --- src/include/mutex.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/include/mutex.h (limited to 'src/include/mutex.h') diff --git a/src/include/mutex.h b/src/include/mutex.h new file mode 100644 index 0000000..50b5606 --- /dev/null +++ b/src/include/mutex.h @@ -0,0 +1,15 @@ +#ifndef DEF_MUTEX_H +#define DEF_MUTEX_H + +#include + +#define MUTEX_LOCKED 1 +#define MUTEX_UNLOCKED 0 + +//A mutex is just an uint32_t + +void mutex_lock(uint32_t* mutex); //wait for mutex to be free +int mutex_lockE(uint32_t* mutex); //lock mutex only if free, returns !0 if locked, 0 if was busy +void mutex_unlock(uint32_t* mutex); + +#endif -- cgit v1.2.3