X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fworkqueue.c;h=94bd514c59f365cca9a846619310d698e3c312aa;hb=04ab0de39e8a8f7c70fce56b42b8fab2d42df7ea;hp=0b1a9eae41f91ba5bad8dc7e43db2731707d8854;hpb=73d8b52e55af02475eb693a33b36fcfbcf761c9a;p=urcu.git diff --git a/src/workqueue.c b/src/workqueue.c index 0b1a9ea..94bd514 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; @@ -124,7 +124,7 @@ static int set_thread_cpu_affinity(struct urcu_workqueue *workqueue) return ret; } #else -static int set_thread_cpu_affinity(struct urcu_workqueue *workqueue) +static int set_thread_cpu_affinity(struct urcu_workqueue *workqueue __attribute__((unused))) { return 0; } @@ -244,11 +244,12 @@ static void *workqueue_thread(void *arg) * urcu_work list. */ cmm_smp_mb(); - } else { - (void) poll(NULL, 0, 10); } } 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);