From: Mathieu Desnoyers Date: Tue, 21 Aug 2012 15:01:50 +0000 (-0400) Subject: Fix: rculfhash should be offline while waiting for resize to complete X-Git-Tag: v0.7.4~2 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=285b448165d2685018eb6b73362fcd3c047c7921;p=userspace-rcu.git Fix: rculfhash should be offline while waiting for resize to complete Causes hang on destroy with urcu QSBR if destroy is called within a rcu registered thread. Signed-off-by: Mathieu Desnoyers --- diff --git a/rculfhash.c b/rculfhash.c index 3ad3618..b8fbb64 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -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;