Support to multi-threading and pthread interface (POSIX.1-2008) (#23)
[lunaix-os.git] / lunaix-os / kernel / ds / mutex.c
index 6af1087be1859a7755b70c6c2e32f398e01490cb..fd14df5042800aa55a4b14b15cecceed245bf1a3 100644 (file)
@@ -1,5 +1,6 @@
 #include <lunaix/ds/mutex.h>
 #include <lunaix/process.h>
+#include <lunaix/sched.h>
 
 void
 mutex_lock(mutex_t* mutex)
@@ -10,7 +11,7 @@ mutex_lock(mutex_t* mutex)
     }
 
     while (atomic_load(&mutex->lk)) {
-        sched_yieldk();
+        sched_pass();
     }
 
     atomic_fetch_add(&mutex->lk, 1);