[svn-commits] file: branch 1.6.0 r117137 - in /branches/1.6.0: ./ res/res_smdi.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon May 19 11:58:10 CDT 2008


Author: file
Date: Mon May 19 11:58:10 2008
New Revision: 117137

URL: http://svn.digium.com/view/asterisk?view=rev&rev=117137
Log:
Merged revisions 117136 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r117136 | file | 2008-05-19 13:53:33 -0300 (Mon, 19 May 2008) | 14 lines

Merged revisions 117135 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r117135 | file | 2008-05-19 13:50:52 -0300 (Mon, 19 May 2008) | 6 lines

Use the right pthread lock and condition when waiting.
(closes issue #12664)
Reported by: tomo1657
Patches:
      res_smdi.c.patch uploaded by tomo1657 (license 484)

........

................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/res/res_smdi.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/res/res_smdi.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/res/res_smdi.c?view=diff&rev=117137&r1=117136&r2=117137
==============================================================================
--- branches/1.6.0/res/res_smdi.c (original)
+++ branches/1.6.0/res/res_smdi.c Mon May 19 11:58:10 2008
@@ -389,6 +389,19 @@
 	struct timeval start;
 	long diff = 0;
 	void *msg;
+	ast_cond_t *cond = NULL;
+	ast_mutex_t *lock = NULL;
+
+	switch (type) {
+	case SMDI_MWI:
+		cond = &iface->mwi_q_cond;
+		lock = &iface->mwi_q_lock;
+		break;
+	case SMDI_MD:
+		cond = &iface->md_q_cond;
+		lock = &iface->md_q_lock;
+		break;
+	}
 
 	start = ast_tvnow();
 
@@ -410,7 +423,7 @@
 		/* If there were no messages in the queue, then go to sleep until one
 		 * arrives. */
 
-		ast_cond_timedwait(&iface->md_q_cond, &iface->md_q_lock, &ts);
+		ast_cond_timedwait(cond, lock, &ts);
 
 		if ((msg = smdi_msg_find(iface, type, station))) {
 			unlock_msg_q(iface, type);




More information about the svn-commits mailing list