URCU_BP_LIB=$(top_builddir)/liburcu-bp.la
URCU_CDS_LIB=$(top_builddir)/liburcu-cds.la
+DEBUG_YIELD_LIB=$(builddir)/../common/libdebug-yield.la
+
EXTRA_DIST = *.sh
test_urcu_SOURCES = test_urcu.c $(URCU)
test_urcu_timing_SOURCES = test_urcu_timing.c $(URCU)
test_urcu_yield_SOURCES = test_urcu.c $(URCU)
+test_urcu_yield_LDADD = $(DEBUG_YIELD_LIB)
test_urcu_yield_CFLAGS = -DDEBUG_YIELD $(AM_CFLAGS)
test_urcu_signal_timing_CFLAGS= -DRCU_SIGNAL $(AM_CFLAGS)
test_urcu_signal_yield_SOURCES = test_urcu.c $(URCU_SIGNAL)
+test_urcu_signal_yield_LDADD = $(DEBUG_YIELD_LIB)
test_urcu_signal_yield_CFLAGS = -DRCU_SIGNAL -DDEBUG_YIELD $(AM_CFLAGS)
test_rwlock_timing_SOURCES = test_rwlock_timing.c $(URCU_SIGNAL)
#ifndef DYNAMIC_LINK_TEST
#define _LGPL_SOURCE
-#else
-#define debug_yield_read()
#endif
#include <urcu.h>
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
argv[0]);
printf("OPTIONS:\n");
-#ifdef DEBUG_YIELD
- printf(" [-r] [-w] (yield reader and/or writer)\n");
-#endif
printf(" [-d delay] (writer period (us))\n");
printf(" [-c duration] (reader C.S. duration (in loops))\n");
printf(" [-e duration] (writer C.S. duration (in loops))\n");
if (argv[i][0] != '-')
continue;
switch (argv[i][1]) {
-#ifdef DEBUG_YIELD
- case 'r':
- yield_active |= YIELD_READ;
- break;
- case 'w':
- yield_active |= YIELD_WRITE;
- break;
-#endif
case 'a':
if (argc < i + 2) {
show_usage(argc, argv);
#ifndef DYNAMIC_LINK_TEST
#define _LGPL_SOURCE
-#else
-#define debug_yield_read()
#endif
#include <urcu.h>
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
argv[0]);
printf("OPTIONS:\n");
-#ifdef DEBUG_YIELD
- printf(" [-r] [-w] (yield reader and/or writer)\n");
-#endif
printf(" [-d delay] (writer period (us))\n");
printf(" [-c duration] (reader C.S. duration (in loops))\n");
printf(" [-e duration] (writer C.S. duration (in loops))\n");
if (argv[i][0] != '-')
continue;
switch (argv[i][1]) {
-#ifdef DEBUG_YIELD
- case 'r':
- yield_active |= YIELD_READ;
- break;
- case 'w':
- yield_active |= YIELD_WRITE;
- break;
-#endif
case 'a':
if (argc < i + 2) {
show_usage(argc, argv);
#ifndef DYNAMIC_LINK_TEST
#define _LGPL_SOURCE
-#else
-#define debug_yield_read()
#endif
#include <urcu.h>
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
argv[0]);
printf("OPTIONS:\n");
-#ifdef DEBUG_YIELD
- printf(" [-r] [-w] (yield reader and/or writer)\n");
-#endif
printf(" [-d delay] (writer period (us))\n");
printf(" [-c duration] (reader C.S. duration (in loops))\n");
printf(" [-e duration] (writer C.S. duration (in loops))\n");
if (argv[i][0] != '-')
continue;
switch (argv[i][1]) {
-#ifdef DEBUG_YIELD
- case 'r':
- yield_active |= YIELD_READ;
- break;
- case 'w':
- yield_active |= YIELD_WRITE;
- break;
-#endif
case 'a':
if (argc < i + 2) {
show_usage(argc, argv);
#include <urcu/tls-compat.h>
#include "cpuset.h"
#include "thread-id.h"
+#include <../common/debug-yield.h>
/* hardcoded number of CPUs */
#define NR_CPUS 16384
#ifndef DYNAMIC_LINK_TEST
#define _LGPL_SOURCE
-#else
-#define rcu_debug_yield_read()
#endif
#include <urcu.h>
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
argv[0]);
printf("OPTIONS:\n");
-#ifdef DEBUG_YIELD
printf(" [-r] [-w] (yield reader and/or writer)\n");
-#endif
printf(" [-d delay] (writer period (us))\n");
printf(" [-c duration] (reader C.S. duration (in loops))\n");
printf(" [-e duration] (writer C.S. duration (in loops))\n");
if (argv[i][0] != '-')
continue;
switch (argv[i][1]) {
-#ifdef DEBUG_YIELD
case 'r':
- rcu_yield_active |= RCU_YIELD_READ;
+ rcu_debug_yield_enable(RCU_YIELD_READ);
break;
case 'w':
- rcu_yield_active |= RCU_YIELD_WRITE;
+ rcu_debug_yield_enable(RCU_YIELD_WRITE);
break;
-#endif
case 'a':
if (argc < i + 2) {
show_usage(argc, argv);
#include <urcu/tls-compat.h>
#include "cpuset.h"
#include "thread-id.h"
+#include "../common/debug-yield.h"
/* hardcoded number of CPUs */
#define NR_CPUS 16384
#ifndef DYNAMIC_LINK_TEST
#define _LGPL_SOURCE
-#else
-#define rcu_debug_yield_read()
#endif
#include <urcu.h>
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
argv[0]);
printf("OPTIONS:\n");
-#ifdef DEBUG_YIELD
printf(" [-r] [-w] (yield reader and/or writer)\n");
-#endif
printf(" [-d delay] (writer period (us))\n");
printf(" [-c duration] (reader C.S. duration (in loops))\n");
printf(" [-e duration] (writer C.S. duration (in loops))\n");
if (argv[i][0] != '-')
continue;
switch (argv[i][1]) {
-#ifdef DEBUG_YIELD
case 'r':
- rcu_yield_active |= RCU_YIELD_READ;
+ rcu_debug_yield_enable(RCU_YIELD_READ);
break;
case 'w':
- rcu_yield_active |= RCU_YIELD_WRITE;
+ rcu_debug_yield_enable(RCU_YIELD_WRITE);
break;
-#endif
case 'a':
if (argc < i + 2) {
show_usage(argc, argv);
#include <urcu/tls-compat.h>
#include "cpuset.h"
#include "thread-id.h"
+#include "../common/debug-yield.h"
/* hardcoded number of CPUs */
#define NR_CPUS 16384
#ifndef DYNAMIC_LINK_TEST
#define _LGPL_SOURCE
-#else
-#define rcu_debug_yield_read()
#endif
#include <urcu-bp.h>
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
argv[0]);
printf("OPTIONS:\n");
-#ifdef DEBUG_YIELD
printf(" [-r] [-w] (yield reader and/or writer)\n");
-#endif
printf(" [-d delay] (writer period (us))\n");
printf(" [-c duration] (reader C.S. duration (in loops))\n");
printf(" [-e duration] (writer C.S. duration (in loops))\n");
if (argv[i][0] != '-')
continue;
switch (argv[i][1]) {
-#ifdef DEBUG_YIELD
case 'r':
- rcu_yield_active |= RCU_YIELD_READ;
+ rcu_debug_yield_enable(RCU_YIELD_READ);
break;
case 'w':
- rcu_yield_active |= RCU_YIELD_WRITE;
+ rcu_debug_yield_enable(RCU_YIELD_WRITE);
break;
-#endif
case 'a':
if (argc < i + 2) {
show_usage(argc, argv);
#include <urcu/tls-compat.h>
#include "cpuset.h"
#include "thread-id.h"
+#include "../common/debug-yield.h"
/* hardcoded number of CPUs */
#define NR_CPUS 16384
#ifndef DYNAMIC_LINK_TEST
#define _LGPL_SOURCE
-#else
-#define rcu_debug_yield_read()
#endif
#include <urcu.h>
#include <urcu-defer.h>
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
argv[0]);
printf("OPTIONS:\n");
-#ifdef DEBUG_YIELD
printf(" [-r] [-w] (yield reader and/or writer)\n");
-#endif
printf(" [-d delay] (writer period (us))\n");
printf(" [-c duration] (reader C.S. duration (in loops))\n");
printf(" [-e duration] (writer C.S. duration (in loops))\n");
if (argv[i][0] != '-')
continue;
switch (argv[i][1]) {
-#ifdef DEBUG_YIELD
case 'r':
- rcu_yield_active |= RCU_YIELD_READ;
+ rcu_debug_yield_enable(RCU_YIELD_READ);
break;
case 'w':
- rcu_yield_active |= RCU_YIELD_WRITE;
+ rcu_debug_yield_enable(RCU_YIELD_WRITE);
break;
-#endif
case 'a':
if (argc < i + 2) {
show_usage(argc, argv);
#include <urcu/tls-compat.h>
#include "cpuset.h"
#include "thread-id.h"
+#include "../common/debug-yield.h"
/* hardcoded number of CPUs */
#define NR_CPUS 16384
#ifndef DYNAMIC_LINK_TEST
#define _LGPL_SOURCE
-#else
-#define rcu_debug_yield_read()
#endif
#include <urcu.h>
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
argv[0]);
printf("OPTIONS:\n");
-#ifdef DEBUG_YIELD
printf(" [-r] [-w] (yield reader and/or writer)\n");
-#endif
printf(" [-d delay] (writer period (us))\n");
printf(" [-c duration] (reader C.S. duration (in loops))\n");
printf(" [-e duration] (writer C.S. duration (in loops))\n");
if (argv[i][0] != '-')
continue;
switch (argv[i][1]) {
-#ifdef DEBUG_YIELD
case 'r':
- rcu_yield_active |= RCU_YIELD_READ;
+ rcu_debug_yield_enable(RCU_YIELD_READ);
break;
case 'w':
- rcu_yield_active |= RCU_YIELD_WRITE;
+ rcu_debug_yield_enable(RCU_YIELD_WRITE);
break;
-#endif
case 'a':
if (argc < i + 2) {
show_usage(argc, argv);
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
argv[0]);
printf("OPTIONS:\n");
-#ifdef DEBUG_YIELD
printf(" [-r] [-w] (yield reader and/or writer)\n");
-#endif
printf(" [-d delay] (writer period (us))\n");
printf(" [-c duration] (reader C.S. duration (in loops))\n");
printf(" [-v] (verbose output)\n");
if (argv[i][0] != '-')
continue;
switch (argv[i][1]) {
-#ifdef DEBUG_YIELD
case 'r':
- yield_active |= YIELD_READ;
+ rcu_debug_yield_enable(RCU_YIELD_READ);
break;
case 'w':
- yield_active |= YIELD_WRITE;
+ rcu_debug_yield_enable(RCU_YIELD_WRITE);
break;
-#endif
case 'a':
if (argc < i + 2) {
show_usage(argc, argv);
#include <urcu/tls-compat.h>
#include "cpuset.h"
#include "thread-id.h"
+#include "../common/debug-yield.h"
#define DEFAULT_HASH_SIZE 32
#define DEFAULT_MIN_ALLOC_SIZE 1
#include <urcu/tls-compat.h>
#include "cpuset.h"
#include "thread-id.h"
+#include "../common/debug-yield.h"
/* hardcoded number of CPUs */
#define NR_CPUS 16384
#ifndef DYNAMIC_LINK_TEST
#define _LGPL_SOURCE
-#else
-#define rcu_debug_yield_read()
#endif
#include "urcu-qsbr.h"
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
argv[0]);
printf("OPTIONS:\n");
-#ifdef DEBUG_YIELD
printf(" [-r] [-w] (yield reader and/or writer)\n");
-#endif
printf(" [-d delay] (writer period (us))\n");
printf(" [-c duration] (reader C.S. duration (in loops))\n");
printf(" [-e duration] (writer C.S. duration (in loops))\n");
if (argv[i][0] != '-')
continue;
switch (argv[i][1]) {
-#ifdef DEBUG_YIELD
case 'r':
- rcu_yield_active |= RCU_RCU_YIELD_READ;
+ rcu_debug_yield_enable(RCU_YIELD_READ);
break;
case 'w':
- rcu_yield_active |= RCU_RCU_YIELD_WRITE;
+ rcu_debug_yield_enable(RCU_YIELD_WRITE);
break;
-#endif
case 'a':
if (argc < i + 2) {
show_usage(argc, argv);
#include <urcu/tls-compat.h>
#include "cpuset.h"
#include "thread-id.h"
+#include "../common/debug-yield.h"
/* hardcoded number of CPUs */
#define NR_CPUS 16384
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
argv[0]);
printf("OPTIONS:\n");
-#ifdef DEBUG_YIELD
printf(" [-r] [-w] (yield reader and/or writer)\n");
-#endif
printf(" [-b batch] (batch reclaim)\n");
printf(" [-d delay] (writer period (us))\n");
printf(" [-c duration] (reader C.S. duration (in loops))\n");
if (argv[i][0] != '-')
continue;
switch (argv[i][1]) {
-#ifdef DEBUG_YIELD
case 'r':
- rcu_yield_active |= RCU_YIELD_READ;
+ rcu_debug_yield_enable(RCU_YIELD_READ);
break;
case 'w':
- rcu_yield_active |= RCU_YIELD_WRITE;
+ rcu_debug_yield_enable(RCU_YIELD_WRITE);
break;
-#endif
case 'a':
if (argc < i + 2) {
show_usage(argc, argv);
noinst_HEADERS = cpuset.h thread-id.h
+noinst_LTLIBRARIES = libdebug-yield.la
+
+libdebug_yield_la_SOURCES = debug-yield.c debug-yield.h
+
EXTRA_DIST = api.h
--- /dev/null
+/*
+ * debug-yield.c
+ *
+ * Userspace RCU library tests - Debugging code
+ *
+ * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (c) 2009 Paul E. McKenney, IBM Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * IBM's contributions to this file may be relicensed under LGPLv2 or later.
+ */
+
+#include <urcu/tls-compat.h>
+#include "debug-yield.h"
+
+unsigned int rcu_yield_active;
+
+DEFINE_URCU_TLS(unsigned int, rcu_rand_yield);
--- /dev/null
+#ifndef URCU_TESTS_DEBUG_YIELD_H
+#define URCU_TESTS_DEBUG_YIELD_H
+
+/*
+ * debug-yield.h
+ *
+ * Userspace RCU library tests - Debugging header
+ *
+ * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (c) 2009 Paul E. McKenney, IBM Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * IBM's contributions to this file may be relicensed under LGPLv2 or later.
+ */
+
+#include <sched.h>
+#include <time.h>
+#include <pthread.h>
+#include <unistd.h>
+
+#define RCU_YIELD_READ (1 << 0)
+#define RCU_YIELD_WRITE (1 << 1)
+
+/*
+ * Updates with RCU_SIGNAL are much slower. Account this in the delay.
+ */
+#ifdef RCU_SIGNAL
+/* maximum sleep delay, in us */
+#define MAX_SLEEP 30000
+#else
+#define MAX_SLEEP 50
+#endif
+
+extern unsigned int rcu_yield_active;
+extern DECLARE_URCU_TLS(unsigned int, rcu_rand_yield);
+
+#ifdef DEBUG_YIELD
+static inline void rcu_debug_yield_read(void)
+{
+ if (rcu_yield_active & RCU_YIELD_READ)
+ if (rand_r(&URCU_TLS(rcu_rand_yield)) & 0x1)
+ usleep(rand_r(&URCU_TLS(rcu_rand_yield)) % MAX_SLEEP);
+}
+
+static inline void rcu_debug_yield_write(void)
+{
+ if (rcu_yield_active & RCU_YIELD_WRITE)
+ if (rand_r(&URCU_TLS(rcu_rand_yield)) & 0x1)
+ usleep(rand_r(&URCU_TLS(rcu_rand_yield)) % MAX_SLEEP);
+}
+
+static inline void rcu_debug_yield_enable(unsigned int flags)
+{
+ rcu_yield_active |= flags;
+}
+
+static inline void rcu_debug_yield_disable(unsigned int flags)
+{
+ rcu_yield_active &= ~flags;
+}
+
+static inline void rcu_debug_yield_init(void)
+{
+ URCU_TLS(rcu_rand_yield) = time(NULL) ^ (unsigned long) pthread_self();
+}
+#else /* DEBUG_YIELD */
+static inline void rcu_debug_yield_read(void)
+{
+}
+
+static inline void rcu_debug_yield_write(void)
+{
+}
+
+static inline void rcu_debug_yield_enable(unsigned int flags)
+{
+}
+
+static inline void rcu_debug_yield_disable(unsigned int flags)
+{
+}
+
+static inline void rcu_debug_yield_init(void)
+{
+}
+#endif
+
+#endif /* URCU_TESTS_DEBUG_YIELD_H */
*/
__DEFINE_URCU_TLS_GLOBAL(struct rcu_reader, rcu_reader);
-#ifdef DEBUG_YIELD
-unsigned int rcu_yield_active;
-__DEFINE_URCU_TLS_GLOBAL(unsigned int, rcu_rand_yield);
-#endif
-
static CDS_LIST_HEAD(registry);
/*
#define rcu_flavor rcu_flavor_qsbr
-#define rcu_yield_active rcu_yield_active_memb_qsbr
-#define rcu_rand_yield rcu_rand_yield_memb_qsbr
-
#endif /* _URCU_QSBR_MAP_H */
#define rcu_flavor rcu_flavor_memb
-#define rcu_yield_active rcu_yield_active_memb
-#define rcu_rand_yield rcu_rand_yield_memb
-
/* Specific to MEMBARRIER flavor */
#define rcu_has_sys_membarrier rcu_has_sys_membarrier_memb
#define rcu_flavor rcu_flavor_sig
-#define rcu_yield_active rcu_yield_active_sig
-#define rcu_rand_yield rcu_rand_yield_sig
-
#elif defined(RCU_MB)
#define rcu_read_lock rcu_read_lock_mb
#define rcu_flavor rcu_flavor_mb
-#define rcu_yield_active rcu_yield_active_mb
-#define rcu_rand_yield rcu_rand_yield_mb
-
#else
#error "Undefined selection"
RCU_READER_INACTIVE,
};
-#ifdef DEBUG_YIELD
-#include <sched.h>
-#include <time.h>
-#include <pthread.h>
-#include <unistd.h>
-
-#define RCU_YIELD_READ (1 << 0)
-#define RCU_YIELD_WRITE (1 << 1)
-
-/*
- * Updates without RCU_MB are much slower. Account this in
- * the delay.
- */
-/* maximum sleep delay, in us */
-#define MAX_SLEEP 50
-
-extern unsigned int rcu_yield_active;
-extern DECLARE_URCU_TLS(unsigned int, rcu_rand_yield);
-
-static inline void rcu_debug_yield_read(void)
-{
- if (rcu_yield_active & RCU_YIELD_READ)
- if (rand_r(&URCU_TLS(rcu_rand_yield)) & 0x1)
- usleep(rand_r(&URCU_TLS(rcu_rand_yield)) % MAX_SLEEP);
-}
-
-static inline void rcu_debug_yield_write(void)
-{
- if (rcu_yield_active & RCU_YIELD_WRITE)
- if (rand_r(&URCU_TLS(rcu_rand_yield)) & 0x1)
- usleep(rand_r(&URCU_TLS(rcu_rand_yield)) % MAX_SLEEP);
-}
-
-static inline void rcu_debug_yield_init(void)
-{
- URCU_TLS(rcu_rand_yield) = time(NULL) ^ (unsigned long) pthread_self();
-}
-#else
-static inline void rcu_debug_yield_read(void)
-{
-}
-
-static inline void rcu_debug_yield_write(void)
-{
-}
-
-static inline void rcu_debug_yield_init(void)
-{
-
-}
-#endif
-
/*
* The trick here is that RCU_GP_CTR_PHASE must be a multiple of 8 so we can use a
* full 8-bits, 16-bits or 32-bits bitmask for the lower order bits.
RCU_READER_INACTIVE,
};
-#ifdef DEBUG_YIELD
-#include <sched.h>
-#include <time.h>
-#include <pthread.h>
-#include <unistd.h>
-
-#define RCU_YIELD_READ (1 << 0)
-#define RCU_YIELD_WRITE (1 << 1)
-
-/* maximum sleep delay, in us */
-#define MAX_SLEEP 50
-
-extern unsigned int rcu_yield_active;
-extern DECLARE_URCU_TLS(unsigned int, rcu_rand_yield);
-
-static inline void rcu_debug_yield_read(void)
-{
- if (rcu_yield_active & RCU_YIELD_READ)
- if (rand_r(&URCU_TLS(rcu_rand_yield)) & 0x1)
- usleep(rand_r(&URCU_TLS(rcu_rand_yield)) % MAX_SLEEP);
-}
-
-static inline void rcu_debug_yield_write(void)
-{
- if (rcu_yield_active & RCU_YIELD_WRITE)
- if (rand_r(&URCU_TLS(rcu_rand_yield)) & 0x1)
- usleep(rand_r(&URCU_TLS(rcu_rand_yield)) % MAX_SLEEP);
-}
-
-static inline void rcu_debug_yield_init(void)
-{
- URCU_TLS(rcu_rand_yield) = time(NULL) ^ (unsigned long) pthread_self();
-}
-#else
-static inline void rcu_debug_yield_read(void)
-{
-}
-
-static inline void rcu_debug_yield_write(void)
-{
-}
-
-static inline void rcu_debug_yield_init(void)
-{
-
-}
-#endif
-
#define RCU_GP_ONLINE (1UL << 0)
#define RCU_GP_CTR (1UL << 1)
#define rcu_assert(args...)
#endif
-#ifdef DEBUG_YIELD
-#include <sched.h>
-#include <time.h>
-#include <pthread.h>
-#include <unistd.h>
-
-#define RCU_YIELD_READ (1 << 0)
-#define RCU_YIELD_WRITE (1 << 1)
-
-/*
- * Updates with RCU_SIGNAL are much slower. Account this in the delay.
- */
-#ifdef RCU_SIGNAL
-/* maximum sleep delay, in us */
-#define MAX_SLEEP 30000
-#else
-#define MAX_SLEEP 50
-#endif
-
-extern unsigned int rcu_yield_active;
-extern DECLARE_URCU_TLS(unsigned int, rcu_rand_yield);
-
-static inline void rcu_debug_yield_read(void)
-{
- if (rcu_yield_active & RCU_YIELD_READ)
- if (rand_r(&URCU_TLS(rcu_rand_yield)) & 0x1)
- usleep(rand_r(&URCU_TLS(rcu_rand_yield)) % MAX_SLEEP);
-}
-
-static inline void rcu_debug_yield_write(void)
-{
- if (rcu_yield_active & RCU_YIELD_WRITE)
- if (rand_r(&URCU_TLS(rcu_rand_yield)) & 0x1)
- usleep(rand_r(&URCU_TLS(rcu_rand_yield)) % MAX_SLEEP);
-}
-
-static inline void rcu_debug_yield_init(void)
-{
- URCU_TLS(rcu_rand_yield) = time(NULL) ^ (unsigned long) pthread_self();
-}
-#else
-static inline void rcu_debug_yield_read(void)
-{
-}
-
-static inline void rcu_debug_yield_write(void)
-{
-}
-
-static inline void rcu_debug_yield_init(void)
-{
-
-}
-#endif
-
/*
* RCU memory barrier broadcast group. Currently, only broadcast to all process
* threads is supported (group 0).