projects
/
userspace-rcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LGPLv2.1 relicensing
[userspace-rcu.git]
/
test_urcu_timing.c
diff --git
a/test_urcu_timing.c
b/test_urcu_timing.c
index ac23846d784f783c1c34d86beab2323bc8381995..a11532a90c7fce740b2857b306412067d568cd29 100644
(file)
--- a/
test_urcu_timing.c
+++ b/
test_urcu_timing.c
@@
-18,6
+18,7
@@
#include <stdio.h>
#include <assert.h>
#include <sys/syscall.h>
#include <stdio.h>
#include <assert.h>
#include <sys/syscall.h>
+#include <arch.h>
#if defined(_syscall0)
_syscall0(pid_t, gettid)
#if defined(_syscall0)
_syscall0(pid_t, gettid)
@@
-34,6
+35,7
@@
static inline pid_t gettid(void)
}
#endif
}
#endif
+#define _LGPL_SOURCE
#include "urcu.h"
pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
#include "urcu.h"
pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
@@
-86,7
+88,7
@@
void *thr_reader(void *arg)
"reader", pthread_self(), (unsigned long)gettid());
sleep(2);
"reader", pthread_self(), (unsigned long)gettid());
sleep(2);
-
u
rcu_register_thread();
+ rcu_register_thread();
time1 = get_cycles();
for (i = 0; i < OUTER_READ_LOOP; i++) {
time1 = get_cycles();
for (i = 0; i < OUTER_READ_LOOP; i++) {
@@
-101,7
+103,7
@@
void *thr_reader(void *arg)
}
time2 = get_cycles();
}
time2 = get_cycles();
-
u
rcu_unregister_thread();
+ rcu_unregister_thread();
reader_time[(unsigned long)arg] = time2 - time1;
reader_time[(unsigned long)arg] = time2 - time1;
@@
-129,7
+131,7
@@
void *thr_writer(void *arg)
assert(old->a == 8);
}
new->a = 8;
assert(old->a == 8);
}
new->a = 8;
- old =
u
rcu_publish_content(&test_rcu_pointer, new);
+ old = rcu_publish_content(&test_rcu_pointer, new);
rcu_copy_mutex_unlock();
/* can be done after unlock */
if (old) {
rcu_copy_mutex_unlock();
/* can be done after unlock */
if (old) {
This page took
0.023564 seconds
and
4
git commands to generate.