projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove glibc < 2.4 compat code for sched_setaffinity
[urcu.git]
/
src
/
workqueue.c
diff --git
a/src/workqueue.c
b/src/workqueue.c
index 6707ffe3b45e2c2226d99c3b163d4e1c820028aa..1e045fb7d4c40cf9d271878b8638d39a43b5fa49 100644
(file)
--- a/
src/workqueue.c
+++ b/
src/workqueue.c
@@
-36,12
+36,12
@@
#include <sched.h>
#include "compat-getcpu.h"
#include <sched.h>
#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
<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 "urcu-die.h"
#include "workqueue.h"
#include "urcu-die.h"
#include "workqueue.h"
@@
-107,11
+107,8
@@
static int set_thread_cpu_affinity(struct urcu_workqueue *workqueue)
CPU_ZERO(&mask);
CPU_SET(workqueue->cpu_affinity, &mask);
CPU_ZERO(&mask);
CPU_SET(workqueue->cpu_affinity, &mask);
-#if SCHED_SETAFFINITY_ARGS == 2
- ret = sched_setaffinity(0, &mask);
-#else
ret = sched_setaffinity(0, sizeof(mask), &mask);
ret = sched_setaffinity(0, sizeof(mask), &mask);
-#endif
+
/*
* EINVAL is fine: can be caused by hotunplugged CPUs, or by
* cpuset(7). This is why we should always retry if we detect
/*
* EINVAL is fine: can be caused by hotunplugged CPUs, or by
* cpuset(7). This is why we should always retry if we detect
@@
-238,18
+235,18
@@
static void *workqueue_thread(void *arg)
if (cds_wfcq_empty(&workqueue->cbs_head,
&workqueue->cbs_tail)) {
futex_wait(&workqueue->futex);
if (cds_wfcq_empty(&workqueue->cbs_head,
&workqueue->cbs_tail)) {
futex_wait(&workqueue->futex);
- (void) poll(NULL, 0, 10);
uatomic_dec(&workqueue->futex);
/*
* Decrement futex before reading
* urcu_work list.
*/
cmm_smp_mb();
uatomic_dec(&workqueue->futex);
/*
* Decrement futex before reading
* urcu_work list.
*/
cmm_smp_mb();
- } else {
- (void) poll(NULL, 0, 10);
}
} else {
}
} 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);
}
if (workqueue->worker_after_wake_up_fct)
workqueue->worker_after_wake_up_fct(workqueue, workqueue->priv);
This page took
0.024394 seconds
and
4
git commands to generate.