diff --git a/kernel/mutex.h b/kernel/mutex.h new file mode 100644 index 0000000..7c6a1f7 --- /dev/null +++ b/kernel/mutex.h @@ -0,0 +1,22 @@ +/* +Copyright (C) 2015-2019 The University of Notre Dame +This software is distributed under the GNU General Public License. +See the file LICENSE for details. +*/ + +#ifndef MUTEX_H +#define MUTEX_H + +#include "list.h" + +struct mutex { + int locked; + struct list waitqueue; +}; + +#define MUTEX_INIT {0,LIST_INIT} + +void mutex_lock(struct mutex *m); +void mutex_unlock(struct mutex *m); + +#endif