for (;;) {
new = test_array_alloc();
- rcu_copy_mutex_lock();
- old = test_rcu_pointer;
- if (old)
- assert(old->a == 8);
new->a = 8;
old = _rcu_publish_content(&test_rcu_pointer, new);
- rcu_copy_mutex_unlock();
/* can be done after unlock */
if (old)
old->a = 0;
for (;;) {
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();
rcu_gc_reclaim(wtidx, old);
nr_writes++;
if (unlikely(!test_duration_write()))
for (;;) {
new = test_array_alloc();
- rcu_copy_mutex_lock();
- old = test_rcu_pointer;
- if (old)
- assert(old->a == 8);
new->a = 8;
old = rcu_publish_content(&test_rcu_pointer, new);
- rcu_copy_mutex_unlock();
- /* can be done after unlock */
if (old)
old->a = 0;
test_array_free(old);
for (;;) {
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();
rcu_gc_reclaim(wtidx, old);
nr_writes++;
if (unlikely(!test_duration_write()))