X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=test_qsbr_gc.c;h=3a66a845f3636071d9cad298ef1c1f351982bbb6;hp=98094a6c80da23c90d738d9f11d8e29fa6e278bf;hb=ec817b748bf0004a2948937b7d04cd26c106598a;hpb=6af882baf4a7cc82167b8e1abba5d6c851e0e6e8 diff --git a/test_qsbr_gc.c b/test_qsbr_gc.c index 98094a6..3a66a84 100644 --- a/test_qsbr_gc.c +++ b/test_qsbr_gc.c @@ -250,7 +250,11 @@ static void rcu_gc_reclaim(unsigned long wtidx, void *old) void *thr_writer(void *data) { unsigned long wtidx = (unsigned long)data; +#ifdef TEST_LOCAL_GC + struct test_array *old = NULL; +#else struct test_array *new, *old; +#endif printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "writer", pthread_self(), (unsigned long)gettid()); @@ -263,14 +267,11 @@ void *thr_writer(void *data) smp_mb(); for (;;) { +#ifndef TEST_LOCAL_GC new = malloc(sizeof(*new)); - rcu_copy_mutex_lock(); - old = test_rcu_pointer; - if (old) - assert(old->a == 8); new->a = 8; old = _rcu_xchg_pointer(&test_rcu_pointer, new); - rcu_copy_mutex_unlock(); +#endif rcu_gc_reclaim(wtidx, old); nr_writes++; if (unlikely(!test_duration_write()))