fix: use wait queue for blocking process
[lunaix-os.git] / lunaix-os / kernel / ds / waitq.c
index 0d643d02e7de3649d4da25d50c7b9d41258cc4c1..4b5abfd89055024a75bd4f220c808ef9c0b14e33 100644 (file)
@@ -10,8 +10,7 @@ pwait(waitq_t* queue)
 
     llist_append(&queue->waiters, &current_wq->waiters);
 
-    // FIXME centralize the state change.
-    __current->state = PS_BLOCKED;
+    block_current();
     sched_yieldk();
 }