projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add rcu_read_ongoing() API to each urcu flavor
[urcu.git]
/
tests
/
test_urcu_qsbr.c
diff --git
a/tests/test_urcu_qsbr.c
b/tests/test_urcu_qsbr.c
index d5d893c338aad555ff58bb988246338067f56aed..f98e2735ef2004b911a78b1def6da07c694ca028 100644
(file)
--- a/
tests/test_urcu_qsbr.c
+++ b/
tests/test_urcu_qsbr.c
@@
-31,11
+31,11
@@
#include <unistd.h>
#include <stdio.h>
#include <assert.h>
#include <unistd.h>
#include <stdio.h>
#include <assert.h>
-#include <sched.h>
#include <errno.h>
#include <urcu/arch.h>
#include <urcu/tls-compat.h>
#include <errno.h>
#include <urcu/arch.h>
#include <urcu/tls-compat.h>
+#include "cpuset.h"
#ifdef __linux__
#include <syscall.h>
#ifdef __linux__
#include <syscall.h>
@@
-100,12
+100,6
@@
static int use_affinity = 0;
pthread_mutex_t affinity_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t affinity_mutex = PTHREAD_MUTEX_INITIALIZER;
-#ifndef HAVE_CPU_SET_T
-typedef unsigned long cpu_set_t;
-# define CPU_ZERO(cpuset) do { *(cpuset) = 0; } while(0)
-# define CPU_SET(cpu, cpuset) do { *(cpuset) |= (1UL << (cpu)); } while(0)
-#endif
-
static void set_affinity(void)
{
#if HAVE_SCHED_SETAFFINITY
static void set_affinity(void)
{
#if HAVE_SCHED_SETAFFINITY
@@
-193,6
+187,11
@@
void *thr_reader(void *_count)
rcu_register_thread();
rcu_register_thread();
+ assert(rcu_read_ongoing());
+ rcu_thread_offline();
+ assert(!rcu_read_ongoing());
+ rcu_thread_online();
+
while (!test_go)
{
}
while (!test_go)
{
}
@@
-200,6
+199,7
@@
void *thr_reader(void *_count)
for (;;) {
rcu_read_lock();
for (;;) {
rcu_read_lock();
+ assert(rcu_read_ongoing());
local_ptr = rcu_dereference(test_rcu_pointer);
rcu_debug_yield_read();
if (local_ptr)
local_ptr = rcu_dereference(test_rcu_pointer);
rcu_debug_yield_read();
if (local_ptr)
This page took
0.025109 seconds
and
4
git commands to generate.