[asterisk-commits] file: trunk r44762 - in /trunk: ./ channels/chan_iax2.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Oct 9 08:49:46 MST 2006


Author: file
Date: Mon Oct  9 10:49:45 2006
New Revision: 44762

URL: http://svn.digium.com/view/asterisk?rev=44762&view=rev
Log:
Merged revisions 44759 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r44759 | file | 2006-10-09 11:41:28 -0400 (Mon, 09 Oct 2006) | 2 lines

Properly avoid a collision with iax2_hangup (issue #8115 reported by vazir)

........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_iax2.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?rev=44762&r1=44761&r2=44762&view=diff
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Mon Oct  9 10:49:45 2006
@@ -1674,14 +1674,10 @@
 static int iax2_predestroy(int callno)
 {
 	struct ast_channel *c = NULL;
-	struct chan_iax2_pvt *pvt = NULL;
-
-	ast_mutex_lock(&iaxsl[callno]);
-
-	if (!(pvt = iaxs[callno])) {
-		ast_mutex_unlock(&iaxsl[callno]);
+	struct chan_iax2_pvt *pvt = iaxs[callno];
+
+	if (!pvt)
 		return -1;
-	}
 
 	if (!ast_test_flag(pvt, IAX_ALREADYGONE)) {
 		iax2_destroy_helper(pvt);
@@ -1697,8 +1693,6 @@
 		ast_update_use_count();
 	}
 
-	ast_mutex_unlock(&iaxsl[callno]);
-
 	return 0;
 }
 
@@ -1709,7 +1703,6 @@
 	struct ast_channel *owner = NULL;
 
 retry:
-	ast_mutex_lock(&iaxsl[callno]);
 	pvt = iaxs[callno];
 	gettimeofday(&lastused[callno], NULL);
 	
@@ -1720,6 +1713,7 @@
 			ast_log(LOG_NOTICE, "Avoiding IAX destroy deadlock\n");
 			ast_mutex_unlock(&iaxsl[callno]);
 			usleep(1);
+			ast_mutex_lock(&iaxsl[callno]);
 			goto retry;
 		}
 	}
@@ -1764,7 +1758,6 @@
 	if (owner) {
 		ast_mutex_unlock(&owner->lock);
 	}
-	ast_mutex_unlock(&iaxsl[callno]);
 	if (callno & 0x4000)
 		update_max_trunk();
 }



More information about the asterisk-commits mailing list