X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=test_urcu_gc.c;h=12ea1811173f3520d36b420de05c09da17e280a2;hb=98dcc5ca0ba740c56ecbc1f1c9d2977ef1b2a969;hp=66b714ba072f786e1bc519382543e036f03df50a;hpb=6af882baf4a7cc82167b8e1abba5d6c851e0e6e8;p=urcu.git diff --git a/test_urcu_gc.c b/test_urcu_gc.c index 66b714b..12ea181 100644 --- a/test_urcu_gc.c +++ b/test_urcu_gc.c @@ -251,7 +251,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()); @@ -264,14 +268,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()))