+
+#if defined(RTS_SUPPORTS_THREADS)
+INLINE_HEADER rtsBool
+ANY_WORK_FOR_ME( Condition *cond )
+{
+ // If the run queue is not empty, then we only wake up the guy who
+ // can run the thread at the head, even if there is some other
+ // reason for this task to run (eg. interrupted=rtsTrue).
+ if (!EMPTY_RUN_QUEUE()) {
+ if (run_queue_hd->main == NULL) {
+ return (cond == NULL);
+ } else {
+ return (&run_queue_hd->main->bound_thread_cond == cond);
+ }
+ }
+
+ return blackholes_need_checking
+ || interrupted
+#if defined(RTS_USER_SIGNALS)
+ || signals_pending()
+#endif
+ ;
+}
+#endif
+
+INLINE_HEADER rtsBool
+ANY_WORK_TO_DO(void)
+{
+ return (!EMPTY_RUN_QUEUE()
+ || interrupted
+ || blackholes_need_checking
+#if defined(RTS_USER_SIGNALS)
+ || signals_pending()
+#endif
+ );
+}
+