#include <unistd.h>
#include <stdio.h>
#include <assert.h>
-#include <sys/syscall.h>
#include <sched.h>
#include <errno.h>
#include <urcu/arch.h>
+#ifdef __linux__
+#include <syscall.h>
+#endif
+
/* hardcoded number of CPUs */
#define NR_CPUS 16384
#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;
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++;
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());
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++;
}
-
nr_dequeues++;
if (unlikely(!test_duration_dequeue()))
break;