rculfhash test: move init node outside of rcu read-side c.s. (unneeded protection)
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 27 Sep 2011 21:39:30 +0000 (17:39 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 27 Sep 2011 21:39:30 +0000 (17:39 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/test_urcu_hash.c

index c796b6faa7741ca7697ca0cb73f737dc7a8e1e64..d6464b4b1c23dfb9714acd2053f1e29eb1099bee 100644 (file)
@@ -515,10 +515,10 @@ void *thr_writer(void *_count)
                if ((addremove == AR_ADD || add_only)
                                || (addremove == AR_RANDOM && rand_r(&rand_lookup) & 1)) {
                        node = malloc(sizeof(struct cds_lfht_node));
-                       rcu_read_lock();
                        cds_lfht_node_init(node,
                                (void *)(((unsigned long) rand_r(&rand_lookup) % write_pool_size) + write_pool_offset),
                                sizeof(void *));
+                       rcu_read_lock();
                        if (add_unique) {
                                ret_node = cds_lfht_add_unique(test_ht, node);
                        } else {
This page took 0.033183 seconds and 4 git commands to generate.