projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
urcu-defer: use list instead of array for registry
[urcu.git]
/
tests
/
test_qsbr.c
diff --git
a/tests/test_qsbr.c
b/tests/test_qsbr.c
index 89a94235eedb3d8ddf0d1e542e45017daf503ee2..cf2fec2a8cbc8ce19f366ce669412bf3842ef5f5 100644
(file)
--- a/
tests/test_qsbr.c
+++ b/
tests/test_qsbr.c
@@
-33,7
+33,7
@@
#include <sys/syscall.h>
#include <sched.h>
#include <sys/syscall.h>
#include <sched.h>
-#include
"../arch.h"
+#include
<urcu/arch.h>
/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096
/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096
@@
-56,8
+56,12
@@
static inline pid_t gettid(void)
}
#endif
}
#endif
+#ifndef DYNAMIC_LINK_TEST
#define _LGPL_SOURCE
#define _LGPL_SOURCE
-#include "../urcu-qsbr.h"
+#else
+#define debug_yield_read()
+#endif
+#include "urcu-qsbr.h"
struct test_array {
int a;
struct test_array {
int a;
@@
-215,18
+219,18
@@
void *thr_reader(void *_count)
smp_mb();
for (;;) {
smp_mb();
for (;;) {
-
_
rcu_read_lock();
- local_ptr =
_
rcu_dereference(test_rcu_pointer);
+ rcu_read_lock();
+ local_ptr = rcu_dereference(test_rcu_pointer);
debug_yield_read();
if (local_ptr)
assert(local_ptr->a == 8);
if (unlikely(rduration))
loop_sleep(rduration);
debug_yield_read();
if (local_ptr)
assert(local_ptr->a == 8);
if (unlikely(rduration))
loop_sleep(rduration);
-
_
rcu_read_unlock();
+ rcu_read_unlock();
nr_reads++;
/* QS each 1024 reads */
if (unlikely((nr_reads & ((1 << 10) - 1)) == 0))
nr_reads++;
/* QS each 1024 reads */
if (unlikely((nr_reads & ((1 << 10) - 1)) == 0))
-
_
rcu_quiescent_state();
+ rcu_quiescent_state();
if (unlikely(!test_duration_read()))
break;
}
if (unlikely(!test_duration_read()))
break;
}
@@
-258,7
+262,7
@@
void *thr_writer(void *_count)
for (;;) {
new = test_array_alloc();
new->a = 8;
for (;;) {
new = test_array_alloc();
new->a = 8;
- old =
_
rcu_publish_content(&test_rcu_pointer, new);
+ old = rcu_publish_content(&test_rcu_pointer, new);
/* can be done after unlock */
if (old)
old->a = 0;
/* can be done after unlock */
if (old)
old->a = 0;
This page took
0.023335 seconds
and
4
git commands to generate.