Fix: rculfhash should be offline while waiting for resize to complete
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 21 Aug 2012 15:01:50 +0000 (11:01 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 21 Aug 2012 15:02:53 +0000 (11:02 -0400)
Causes hang on destroy with urcu QSBR if destroy is called within a rcu
registered thread.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rculfhash.c

index 3ad3618aa7297ee5403d176d5c7f0e02be504def..b8fbb6481d9291a6226f2200f8374b810ffd34af 100644 (file)
@@ -1728,8 +1728,10 @@ int cds_lfht_destroy(struct cds_lfht *ht, pthread_attr_t **attr)
        /* Wait for in-flight resize operations to complete */
        _CMM_STORE_SHARED(ht->in_progress_destroy, 1);
        cmm_smp_mb();   /* Store destroy before load resize */
+       ht->flavor->thread_offline();
        while (uatomic_read(&ht->in_progress_resize))
                poll(NULL, 0, 100);     /* wait for 100ms */
+       ht->flavor->thread_online();
        ret = cds_lfht_delete_bucket(ht);
        if (ret)
                return ret;
This page took 0.026786 seconds and 4 git commands to generate.