Module: sip-router
Branch: master
Commit: 54ec52858d97a416d3927b1ea2f58e7ebe46af46
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=54ec528…
Author: Miklos Tirpak <miklos(a)iptel.org>
Committer: Miklos Tirpak <miklos(a)iptel.org>
Date: Mon Sep 14 17:57:40 2009 +0200
tm: callback param free functions can use shm_free()
The release function of the callback parameters is
called outside of the shared memory lock to make the
implementation of such functions easier.
---
modules/tm/h_table.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/modules/tm/h_table.c b/modules/tm/h_table.c
index 06a643c..3acee65 100644
--- a/modules/tm/h_table.c
+++ b/modules/tm/h_table.c
@@ -142,7 +142,13 @@ void free_cell( struct cell* dead_cell )
cbs_tmp = cbs;
cbs = cbs->next;
if (cbs_tmp->release) {
+ /* It is safer to release the shm memory lock
+ * otherwise the release function must to be aware of
+ * the lock state (Miklos)
+ */
+ shm_unlock();
cbs_tmp->release(cbs_tmp->param);
+ shm_lock();
}
shm_free_unsafe( cbs_tmp );
}