[sr-dev] git:master:b2260dca: Merge pull request #151 from sn4kebite/htable-deadlock-fix

Daniel-Constantin Mierla miconda at gmail.com
Thu May 7 11:50:01 CEST 2015


Module: kamailio
Branch: master
Commit: b2260dcad877488799fde3da55a53261f55a27ba
URL: https://github.com/kamailio/kamailio/commit/b2260dcad877488799fde3da55a53261f55a27ba

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-05-07T11:49:55+02:00

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

htable: Add missing ht_slot_unlock in ht_cell_value_add

---

Modified: modules/htable/ht_api.c

---

Diff:  https://github.com/kamailio/kamailio/commit/b2260dcad877488799fde3da55a53261f55a27ba.diff
Patch: https://github.com/kamailio/kamailio/commit/b2260dcad877488799fde3da55a53261f55a27ba.patch

---

diff --git a/modules/htable/ht_api.c b/modules/htable/ht_api.c
index 690f9c7..fb0b117 100644
--- a/modules/htable/ht_api.c
+++ b/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)




More information about the sr-dev mailing list