Fix: only wait if work queue is empty in real-time mode
[urcu.git] / src / workqueue.c
index 39d0e077acc101b5e1588c9a1fae954050bd134c..14957a0d3910aa83740d4e22b5420aa48658cf84 100644 (file)
@@ -246,7 +246,10 @@ static void *workqueue_thread(void *arg)
                                cmm_smp_mb();
                        }
                } else {
-                       (void) poll(NULL, 0, 10);
+                       if (cds_wfcq_empty(&workqueue->cbs_head,
+                                       &workqueue->cbs_tail)) {
+                               (void) poll(NULL, 0, 10);
+                       }
                }
                if (workqueue->worker_after_wake_up_fct)
                        workqueue->worker_after_wake_up_fct(workqueue, workqueue->priv);
This page took 0.02275 seconds and 4 git commands to generate.