summaryrefslogtreecommitdiff
path: root/channels/misdn/isdn_lib_intern.h
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2009-07-15 21:14:41 +0000
committerRichard Mudgett <rmudgett@digium.com>2009-07-15 21:14:41 +0000
commite9e753d6f3f2ba9fa8854dbc24c7a7adc929332f (patch)
treeb49fcf6b89fa1afc9bc7a3dd4cac286ab6b5b645 /channels/misdn/isdn_lib_intern.h
parent3402f34e9b67ee5dd84a2a2869dc8ae44280fadd (diff)
Merged revisions 206706 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r206706 | rmudgett | 2009-07-15 15:44:55 -0500 (Wed, 15 Jul 2009) | 26 lines Merged revision 206700 from https://origsvn.digium.com/svn/asterisk/be/branches/C.2-... .......... Fixed chan_misdn crash because mISDNuser library is not thread safe. With Asterisk the mISDNuser library is driven by two threads concurrently: 1. channels/misdn/isdn_lib.c::manager_event_handler() 2. channels/misdn/isdn_lib.c::misdn_lib_isdn_event_catcher() Calls into the library are done concurrently and recursively from isdn_lib.c. Both threads can fiddle with the master/child layer3_proc_t lists. One thread may traverse the list when the other interrupts it and then removes the list element which the first thread was currently handling. This is exactly what caused the crash. About 60 calls were needed to a Gigaset CX475 before it occurred once. This patch adds locking when calling into the mISDNuser library. This also fixes some cb_log calls with wrong port parameter. JIRA ABE-1913 Patches: misdn-locking.patch (Modified with mostly cosmetic changes) .......... ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@206707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/misdn/isdn_lib_intern.h')
-rw-r--r--channels/misdn/isdn_lib_intern.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/channels/misdn/isdn_lib_intern.h b/channels/misdn/isdn_lib_intern.h
index 7e7ea8a61..3d0fd5428 100644
--- a/channels/misdn/isdn_lib_intern.h
+++ b/channels/misdn/isdn_lib_intern.h
@@ -65,6 +65,7 @@ struct misdn_stack {
/** is first element because &nst equals &mISDNlist **/
net_stack_t nst;
manager_t mgr;
+ pthread_mutex_t nstlock;
/*! \brief D Channel mISDN driver stack ID (Parent stack ID) */
int d_stid;