diff options
Diffstat (limited to 'src/common/include/sched.h')
-rw-r--r-- | src/common/include/sched.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/common/include/sched.h b/src/common/include/sched.h new file mode 100644 index 0000000..0f8f8f4 --- /dev/null +++ b/src/common/include/sched.h @@ -0,0 +1,15 @@ +#ifndef DEF_MUTEX_H +#define DEF_MUTEX_H + +#include <types.h> + +#define MUTEX_LOCKED 1 +#define MUTEX_UNLOCKED 0 + +//A mutex is just an uint32_t + +int 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 |