+/*
+ * Can only be called if the workers are stopped.
+ * If we're stopped, there are also no pending jobs.
+ */
+gboolean
+sgen_workers_have_idle_work (void)
+{
+ int i;
+
+ SGEN_ASSERT (0, forced_stop && sgen_workers_all_done (), "Checking for idle work should only happen if the workers are stopped.");
+
+ if (!sgen_section_gray_queue_is_empty (&workers_distribute_gray_queue))
+ return TRUE;
+
+ for (i = 0; i < workers_num; ++i) {
+ if (!sgen_gray_object_queue_is_empty (&workers_data [i].private_gray_queue))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+