sched: wait: implement wakeup_n, waitqueue_empty
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user