sched: wait: implement wakeup_n, waitqueue_empty

This commit is contained in:
2026-03-18 20:56:15 +00:00
parent 04d05adbe8
commit b774415f64
2 changed files with 27 additions and 0 deletions

View File

@@ -40,6 +40,15 @@ extern void thread_wait_end_nosleep(
struct waitqueue *q);
extern void wait_on_queue(struct waitqueue *q);
extern void wakeup_queue(struct waitqueue *q);
extern void wakeup_n(struct waitqueue *q, size_t n);
extern void wakeup_one(struct waitqueue *q);
static inline bool waitqueue_empty(struct waitqueue *wq)
{
unsigned long flags;
spin_lock_irqsave(&wq->wq_lock, &flags);
bool result = queue_empty(&wq->wq_waiters);
spin_unlock_irqrestore(&wq->wq_lock, flags);
return result;
}
#endif