[asterisk-commits] bweschke: branch 1.4 r43873 - in /branches/1.4: ./ apps/app_queue.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Sep 28 08:29:22 MST 2006


Author: bweschke
Date: Thu Sep 28 10:29:21 2006
New Revision: 43873

URL: http://svn.digium.com/view/asterisk?rev=43873&view=rev
Log:
Merged revisions 43871 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43871 | bweschke | 2006-09-28 11:18:05 -0400 (Thu, 28 Sep 2006) | 3 lines

 Fix race condion crash with get_member_status (#7864 - tim_ringenbach reported and patched)


........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/apps/app_queue.c

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

Modified: branches/1.4/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_queue.c?rev=43873&r1=43872&r2=43873&view=diff
==============================================================================
--- branches/1.4/apps/app_queue.c (original)
+++ branches/1.4/apps/app_queue.c Thu Sep 28 10:29:21 2006
@@ -475,11 +475,12 @@
 	QUEUE_NORMAL
 };
 
-static enum queue_member_status get_member_status(const struct call_queue *q, int max_penalty)
+static enum queue_member_status get_member_status(struct call_queue *q, int max_penalty)
 {
 	struct member *member;
 	enum queue_member_status result = QUEUE_NO_MEMBERS;
 
+	ast_mutex_lock(&q->lock);
 	for (member = q->members; member; member = member->next) {
 		if (max_penalty && (member->penalty > max_penalty))
 			continue;
@@ -494,10 +495,12 @@
 			result = QUEUE_NO_REACHABLE_MEMBERS;
 			break;
 		default:
+			ast_mutex_unlock(&q->lock);
 			return QUEUE_NORMAL;
 		}
 	}
 	
+	ast_mutex_unlock(&q->lock);
 	return result;
 }
 



More information about the asterisk-commits mailing list