projects
/
userspace-rcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests/regression/rcutorture: Add wait state
[userspace-rcu.git]
/
tests
/
regression
/
rcutorture.h
diff --git
a/tests/regression/rcutorture.h
b/tests/regression/rcutorture.h
index ead5b4082ca217e5064dcd350a06799dd4e0ccf6..b3a300c7a1d8d63c816828e5ae49720fa7458246 100644
(file)
--- a/
tests/regression/rcutorture.h
+++ b/
tests/regression/rcutorture.h
@@
-336,6
+336,7
@@
void *rcu_read_stress_test(void *arg __attribute__((unused)))
static pthread_mutex_t call_rcu_test_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t call_rcu_test_cond = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t call_rcu_test_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t call_rcu_test_cond = PTHREAD_COND_INITIALIZER;
+static bool call_rcu_wait;
static
void rcu_update_stress_test_rcu(struct rcu_head *head __attribute__((unused)))
static
void rcu_update_stress_test_rcu(struct rcu_head *head __attribute__((unused)))
@@
-356,6
+357,7
@@
void rcu_update_stress_test_rcu(struct rcu_head *head __attribute__((unused)))
strerror(errno));
abort();
}
strerror(errno));
abort();
}
+ call_rcu_wait = false;
ret = pthread_mutex_unlock(&call_rcu_test_mutex);
if (ret) {
errno = ret;
ret = pthread_mutex_unlock(&call_rcu_test_mutex);
if (ret) {
errno = ret;
@@
-437,8
+439,11
@@
void *rcu_update_stress_test(void *arg __attribute__((unused)))
* immediately after call_rcu (call_rcu needs
* us to be registered RCU readers).
*/
* immediately after call_rcu (call_rcu needs
* us to be registered RCU readers).
*/
- ret = pthread_cond_wait(&call_rcu_test_cond,
- &call_rcu_test_mutex);
+ call_rcu_wait = true;
+ do {
+ ret = pthread_cond_wait(&call_rcu_test_cond,
+ &call_rcu_test_mutex);
+ } while (call_rcu_wait);
if (ret) {
errno = ret;
diag("pthread_cond_signal: %s",
if (ret) {
errno = ret;
diag("pthread_cond_signal: %s",
This page took
0.024609 seconds
and
4
git commands to generate.