summaryrefslogtreecommitdiff
path: root/src/common/include/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/include/sched.h')
-rw-r--r--src/common/include/sched.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/common/include/sched.h b/src/common/include/sched.h
index 0f8f8f4..1fe148d 100644
--- a/src/common/include/sched.h
+++ b/src/common/include/sched.h
@@ -7,9 +7,18 @@
#define MUTEX_UNLOCKED 0
//A mutex is just an uint32_t
+typedef uint32_t mutex_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);
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int mutex_lock(mutex_t* mutex); //wait for mutex to be free
+int mutex_lockE(mutex_t* mutex); //lock mutex only if free, returns !0 if locked, 0 if was busy
+void mutex_unlock(mutex_t* mutex);
+
+#ifdef __cplusplus
+}
+#endif
#endif