summaryrefslogtreecommitdiff
path: root/include/linux/wait-simple.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/wait-simple.h')
-rw-r--r--include/linux/wait-simple.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/wait-simple.h b/include/linux/wait-simple.h
index 4efba4d..f86bca2 100644
--- a/include/linux/wait-simple.h
+++ b/include/linux/wait-simple.h
@@ -47,6 +47,14 @@ extern void swait_prepare(struct swait_head *head, struct swaiter *w, int state)
extern void swait_finish_locked(struct swait_head *head, struct swaiter *w);
extern void swait_finish(struct swait_head *head, struct swaiter *w);
+/* Check whether a head has waiters enqueued */
+static inline bool swaitqueue_active(struct swait_head *h)
+{
+ /* Make sure the condition is visible before checking list_empty() */
+ smp_mb();
+ return !list_empty(&h->list);
+}
+
/*
* Wakeup functions
*/