X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fworkqueue.c;h=c2c9b9c57417855d8b48f85adbcbed9c6cb6bab6;hb=a9e31859feb8d62a3e9d8a434c3f1bd80dbe3076;hp=39d0e077acc101b5e1588c9a1fae954050bd134c;hpb=c6871b650af872296c57dc65f93bd912d2b4435e;p=urcu.git diff --git a/src/workqueue.c b/src/workqueue.c index 39d0e07..c2c9b9c 100644 --- a/src/workqueue.c +++ b/src/workqueue.c @@ -36,12 +36,12 @@ #include #include "compat-getcpu.h" -#include "urcu/wfcqueue.h" -#include "urcu-pointer.h" -#include "urcu/list.h" -#include "urcu/futex.h" -#include "urcu/tls-compat.h" -#include "urcu/ref.h" +#include +#include +#include +#include +#include +#include #include "urcu-die.h" #include "workqueue.h" @@ -92,7 +92,7 @@ struct urcu_workqueue_completion_work { * Losing affinity can be caused by CPU hotunplug/hotplug, or by * cpuset(7). */ -#if HAVE_SCHED_SETAFFINITY +#ifdef HAVE_SCHED_SETAFFINITY static int set_thread_cpu_affinity(struct urcu_workqueue *workqueue) { cpu_set_t mask; @@ -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);