]> rtime.felk.cvut.cz Git - zynq/linux.git/blobdiff - include/linux/wait-simple.h
simple-wait: rename and export the equivalent of waitqueue_active()
[zynq/linux.git] / include / linux / wait-simple.h
index 4efba4d28c48ae434a032f0684b7cbccfe07ad9f..f86bca2c41d53b7bb02c16b7d685782bad80c39e 100644 (file)
@@ -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
  */