From 51af35ffc632f7979fecc609445af8378466d405 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Sat, 4 Dec 2021 18:00:23 -0700 Subject: Created basic Mutex --- src/util/mutex.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/util/mutex.h (limited to 'src/util/mutex.h') diff --git a/src/util/mutex.h b/src/util/mutex.h new file mode 100644 index 0000000..8c9a097 --- /dev/null +++ b/src/util/mutex.h @@ -0,0 +1,15 @@ +#ifndef SYS_MUTEX_H +#define SYS_MUTEX_H + +#define NULL_PID 0 +#define SCHED_PID 1 + +struct Mutex { + unsigned long* addr; + unsigned long pid; +}; + +unsigned char lock_mutex(struct Mutex*, unsigned long); +unsigned char release_mutex(struct Mutex*, unsigned long); + +#endif -- cgit v1.2.1