rculfhash: decrement resize cnt on destroy
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 30 Sep 2011 16:50:11 +0000 (12:50 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 30 Sep 2011 16:50:11 +0000 (12:50 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rculfhash.c

index 93514d429a5d4fe242fec8b102288101e9a1d78f..8a9e0974926d7ce3973f40b92fb629eebc58e0f2 100644 (file)
@@ -1720,8 +1720,10 @@ void cds_lfht_resize_lazy(struct cds_lfht *ht, unsigned long size, int growth)
        if (!CMM_LOAD_SHARED(ht->t.resize_initiated) && size < target_size) {
                uatomic_inc(&ht->in_progress_resize);
                cmm_smp_mb();   /* increment resize count before load destroy */
-               if (CMM_LOAD_SHARED(ht->in_progress_destroy))
+               if (CMM_LOAD_SHARED(ht->in_progress_destroy)) {
+                       uatomic_dec(&ht->in_progress_resize);
                        return;
+               }
                work = malloc(sizeof(*work));
                work->ht = ht;
                ht->cds_lfht_call_rcu(&work->head, do_resize_cb);
@@ -1745,8 +1747,10 @@ void cds_lfht_resize_lazy_count(struct cds_lfht *ht, unsigned long size,
        if (!CMM_LOAD_SHARED(ht->t.resize_initiated)) {
                uatomic_inc(&ht->in_progress_resize);
                cmm_smp_mb();   /* increment resize count before load destroy */
-               if (CMM_LOAD_SHARED(ht->in_progress_destroy))
+               if (CMM_LOAD_SHARED(ht->in_progress_destroy)) {
+                       uatomic_dec(&ht->in_progress_resize);
                        return;
+               }
                work = malloc(sizeof(*work));
                work->ht = ht;
                ht->cds_lfht_call_rcu(&work->head, do_resize_cb);
This page took 0.025818 seconds and 4 git commands to generate.