From: acevest Date: Fri, 19 May 2023 16:40:13 +0000 (+0800) Subject: fix sleep_on X-Git-Url: http://zhaoyanbai.com/repos/dnssec-keygen.html?a=commitdiff_plain;h=11684c454495cc5ea8f4190af6c1e098eb2fdc78;p=kernel.git fix sleep_on --- diff --git a/kernel/wait.c b/kernel/wait.c index e6bdb4e..a94aca8 100644 --- a/kernel/wait.c +++ b/kernel/wait.c @@ -49,11 +49,11 @@ void __end_wait(wait_queue_head_t *head, wait_queue_t *wq) { void sleep_on(wait_queue_head_t *head) { DECLARE_WAIT_QUEUE(wait, current); - current->state = TASK_WAIT; - unsigned long flags; irq_save(flags); + current->state = TASK_WAIT; + list_add_tail(&wait.task_list, &head->task_list); irq_restore(flags);