diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-12 22:35:07 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-12 22:35:07 +0100 |
commit | 9004213b4422e7a43c8ec8aac99d4ecc92553f20 (patch) | |
tree | 2e98e49e582494ce2f514fb388fa351637e5dffc /src/common/include/mutex.h | |
parent | 862b93742237ed959e9b8dc12a536880ea45d0cf (diff) | |
download | kogata-9004213b4422e7a43c8ec8aac99d4ecc92553f20.tar.gz kogata-9004213b4422e7a43c8ec8aac99d4ecc92553f20.zip |
Begin implementation of nullfs.
Diffstat (limited to 'src/common/include/mutex.h')
-rw-r--r-- | src/common/include/mutex.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/include/mutex.h b/src/common/include/mutex.h index 6814adf..88c077e 100644 --- a/src/common/include/mutex.h +++ b/src/common/include/mutex.h @@ -1,6 +1,7 @@ #pragma once #include <stdint.h> +#include <stdbool.h> #define MUTEX_LOCKED 1 #define MUTEX_UNLOCKED 0 @@ -9,7 +10,7 @@ typedef uint32_t mutex_t; void mutex_lock(mutex_t* mutex); //wait for mutex to be free -int mutex_try_lock(mutex_t* mutex); //lock mutex only if free, returns !0 if locked, 0 if was busy +bool mutex_try_lock(mutex_t* mutex); //lock mutex only if free, returns true when locked, false when was busy void mutex_unlock(mutex_t* mutex); // the mutex code assumes a yield() function is defined somewhere |