projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add back uatomic_arch.h for slow deprecation process
[urcu.git]
/
tests
/
test_urcu_lfs.c
diff --git
a/tests/test_urcu_lfs.c
b/tests/test_urcu_lfs.c
index a1d6a1f063946a51ec27348dbdfc6748494d679f..71229da4960c9e30ed34d511e37eb1cdb7f495d2 100644
(file)
--- a/
tests/test_urcu_lfs.c
+++ b/
tests/test_urcu_lfs.c
@@
-62,7
+62,7
@@
static inline pid_t gettid(void)
#define _LGPL_SOURCE
#endif
#include <urcu.h>
#define _LGPL_SOURCE
#endif
#include <urcu.h>
-#include <urcu/
rculfstack
.h>
+#include <urcu/
cds
.h>
#include <urcu-defer.h>
static volatile int test_go, test_stop;
#include <urcu-defer.h>
static volatile int test_go, test_stop;
@@
-177,6
+177,7
@@
void *thr_enqueuer(void *_count)
if (!node)
goto fail;
cds_lfs_node_init_rcu(node);
if (!node)
goto fail;
cds_lfs_node_init_rcu(node);
+ /* No rcu read-side is needed for push */
cds_lfs_push_rcu(&s, node);
nr_successful_enqueues++;
cds_lfs_push_rcu(&s, node);
nr_successful_enqueues++;
@@
-203,6
+204,7
@@
fail:
void *thr_dequeuer(void *_count)
{
unsigned long long *count = _count;
void *thr_dequeuer(void *_count)
{
unsigned long long *count = _count;
+ int ret;
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
"dequeuer", pthread_self(), (unsigned long)gettid());
printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n",
"dequeuer", pthread_self(), (unsigned long)gettid());
@@
-222,13
+224,15
@@
void *thr_dequeuer(void *_count)
cmm_smp_mb();
for (;;) {
cmm_smp_mb();
for (;;) {
- struct cds_lfs_node_rcu *node
= cds_lfs_pop_rcu(&s)
;
+ struct cds_lfs_node_rcu *node;
+ rcu_read_lock();
+ node = cds_lfs_pop_rcu(&s);
+ rcu_read_unlock();
if (node) {
defer_rcu(free, node);
nr_successful_dequeues++;
}
if (node) {
defer_rcu(free, node);
nr_successful_dequeues++;
}
-
nr_dequeues++;
if (unlikely(!test_duration_dequeue()))
break;
nr_dequeues++;
if (unlikely(!test_duration_dequeue()))
break;
This page took
0.025173 seconds
and
4
git commands to generate.