From: Mathieu Desnoyers Date: Mon, 5 Oct 2009 19:03:32 +0000 (-0400) Subject: tests: remove rcu_publish_content dependency X-Git-Tag: v0.2.2~3 X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=commitdiff_plain;h=d2835e6f55477acf4833d6a9774f672288a99075 tests: remove rcu_publish_content dependency API phased-out. Signed-off-by: Mathieu Desnoyers --- diff --git a/tests/test_qsbr.c b/tests/test_qsbr.c index 6230510..d6c4d1a 100644 --- a/tests/test_qsbr.c +++ b/tests/test_qsbr.c @@ -259,7 +259,8 @@ void *thr_writer(void *_count) for (;;) { new = test_array_alloc(); new->a = 8; - old = rcu_publish_content(&test_rcu_pointer, new); + old = rcu_xchg_pointer(&test_rcu_pointer, new); + synchronize_rcu(); /* can be done after unlock */ if (old) old->a = 0; diff --git a/tests/test_qsbr_timing.c b/tests/test_qsbr_timing.c index bbe983e..969b802 100644 --- a/tests/test_qsbr_timing.c +++ b/tests/test_qsbr_timing.c @@ -153,8 +153,9 @@ void *thr_writer(void *arg) assert(old->a == 8); } new->a = 8; - old = _rcu_publish_content(&test_rcu_pointer, new); + old = rcu_xchg_pointer(&test_rcu_pointer, new); rcu_copy_mutex_unlock(); + synchronize_rcu(); /* can be done after unlock */ if (old) { old->a = 0; diff --git a/tests/test_urcu.c b/tests/test_urcu.c index 3b838c1..4289216 100644 --- a/tests/test_urcu.c +++ b/tests/test_urcu.c @@ -256,7 +256,8 @@ void *thr_writer(void *_count) for (;;) { new = test_array_alloc(); new->a = 8; - old = rcu_publish_content(&test_rcu_pointer, new); + old = rcu_xchg_pointer(&test_rcu_pointer, new); + synchronize_rcu(); if (old) old->a = 0; test_array_free(old); diff --git a/tests/test_urcu_bp.c b/tests/test_urcu_bp.c index 8987332..fca7ac5 100644 --- a/tests/test_urcu_bp.c +++ b/tests/test_urcu_bp.c @@ -256,7 +256,8 @@ void *thr_writer(void *_count) for (;;) { new = test_array_alloc(); new->a = 8; - old = rcu_publish_content(&test_rcu_pointer, new); + old = rcu_xchg_pointer(&test_rcu_pointer, new); + synchronize_rcu(); if (old) old->a = 0; test_array_free(old); diff --git a/tests/test_urcu_timing.c b/tests/test_urcu_timing.c index 13c0993..79cd838 100644 --- a/tests/test_urcu_timing.c +++ b/tests/test_urcu_timing.c @@ -152,8 +152,9 @@ void *thr_writer(void *arg) assert(old->a == 8); } new->a = 8; - old = rcu_publish_content(&test_rcu_pointer, new); + old = rcu_xchg_pointer(&test_rcu_pointer, new); rcu_copy_mutex_unlock(); + synchronize_rcu(); /* can be done after unlock */ if (old) { old->a = 0;