summaryrefslogtreecommitdiff
path: root/Source/Kernel/TaskManager/Mutex.class.cpp
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-08-31 00:25:21 +0200
committerAlexis211 <alexis211@gmail.com>2009-08-31 00:25:21 +0200
commit68a8fb4e3b3e9087904b17ce6d81983950b9dca9 (patch)
tree57518642ab813fddfb3887a47f7a01d839d9bb70 /Source/Kernel/TaskManager/Mutex.class.cpp
parent9ad8e2fe0242da26dae7fca2b180640637c8c062 (diff)
downloadMelon-68a8fb4e3b3e9087904b17ce6d81983950b9dca9.tar.gz
Melon-68a8fb4e3b3e9087904b17ce6d81983950b9dca9.zip
We now have complete support for keybord, IN UTF-8 !!
Diffstat (limited to 'Source/Kernel/TaskManager/Mutex.class.cpp')
-rw-r--r--Source/Kernel/TaskManager/Mutex.class.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/Kernel/TaskManager/Mutex.class.cpp b/Source/Kernel/TaskManager/Mutex.class.cpp
new file mode 100644
index 0000000..55226ff
--- /dev/null
+++ b/Source/Kernel/TaskManager/Mutex.class.cpp
@@ -0,0 +1,26 @@
+#include "Mutex.class.h"
+#include <TaskManager/Task.ns.h>
+
+Mutex::Mutex(bool locked) {
+ m_locked = locked;
+}
+
+bool Mutex::lock() {
+ if (m_locked) return false;
+ m_locked = true;
+ return m_locked;
+}
+
+void Mutex::waitLock() {
+ while (m_locked)
+ Task::currentThread->sleep(10); //Wait 10ms
+ m_locked = true;
+}
+
+void Mutex::unlock() {
+ m_locked = false;
+}
+
+bool Mutex::locked() {
+ return m_locked;
+}