mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-11-03 20:38:59 +00:00 
			
		
		
		
	Lock everything that might need to be locked
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		@@ -131,13 +131,17 @@ static void check_bridge(struct local_pvt *p, int isoutbound)
 | 
			
		||||
		/* Masquerade bridged channel into owner */
 | 
			
		||||
		/* Lock other side first */
 | 
			
		||||
		ast_pthread_mutex_lock(&p->chan->bridge->lock);
 | 
			
		||||
		ast_pthread_mutex_lock(&p->owner->lock);
 | 
			
		||||
		ast_channel_masquerade(p->owner, p->chan->bridge);
 | 
			
		||||
		ast_pthread_mutex_unlock(&p->owner->lock);
 | 
			
		||||
		ast_pthread_mutex_unlock(&p->chan->bridge->lock);
 | 
			
		||||
		p->alreadymasqed = 1;
 | 
			
		||||
	} else if (!isoutbound && p->owner && p->owner->bridge && p->chan) {
 | 
			
		||||
		/* Masquerade bridged channel into chan */
 | 
			
		||||
		ast_pthread_mutex_lock(&p->owner->bridge->lock);
 | 
			
		||||
		ast_pthread_mutex_lock(&p->chan->lock);
 | 
			
		||||
		ast_channel_masquerade(p->chan, p->owner->bridge);
 | 
			
		||||
		ast_pthread_mutex_unlock(&p->chan->lock);
 | 
			
		||||
		ast_pthread_mutex_unlock(&p->owner->bridge->lock);
 | 
			
		||||
		p->alreadymasqed = 1;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user