2
0
Эх сурвалжийг харах

Merge pull request #151 from sn4kebite/htable-deadlock-fix

htable: Add missing ht_slot_unlock in ht_cell_value_add
Daniel-Constantin Mierla 10 жил өмнө
parent
commit
b2260dcad8

+ 3 - 0
modules/htable/ht_api.c

@@ -672,7 +672,10 @@ ht_cell_t* ht_cell_value_add(ht_t *ht, str *name, int val, int mode,
 	}
 	/* add val if htable has an integer init value */
 	if(ht->flags!=PV_VAL_INT)
+	{
+		if(mode) ht_slot_unlock(ht, idx);
 		return NULL;
+	}
 	isval.n = ht->initval.n + val;
 	it = ht_cell_new(name, 0, &isval, hid);
 	if(it == NULL)