[asterisk-commits] mmichelson: branch 1.4 r131357 - /branches/1.4/apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 16 14:37:10 CDT 2008


Author: mmichelson
Date: Wed Jul 16 14:37:08 2008
New Revision: 131357

URL: http://svn.digium.com/view/asterisk?view=rev&rev=131357
Log:
Apparently, "thread safety" is important, whatever
that means. :P

(Thanks Russell!)


Modified:
    branches/1.4/apps/app_queue.c

Modified: branches/1.4/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_queue.c?view=diff&rev=131357&r1=131356&r2=131357
==============================================================================
--- branches/1.4/apps/app_queue.c (original)
+++ branches/1.4/apps/app_queue.c Wed Jul 16 14:37:08 2008
@@ -3110,7 +3110,7 @@
 		bridge = ast_bridge_call(qe->chan,peer, &bridge_config);
 
 		if (!attended_transfer_occurred(qe->chan)) {
-			struct ast_datastore *transfer_ds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL);
+			struct ast_datastore *transfer_ds;
 			if (strcasecmp(oldcontext, qe->chan->context) || strcasecmp(oldexten, qe->chan->exten)) {
 				ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%ld|%ld",
 					qe->chan->exten, qe->chan->context, (long) (callstart - qe->start),
@@ -3149,12 +3149,13 @@
 							(long)(time(NULL) - callstart),
 							qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
 			}
+			ast_channel_lock(qe->chan);
+			transfer_ds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL);
 			if (transfer_ds) {
-				ast_channel_lock(qe->chan);
 				ast_channel_datastore_remove(qe->chan, transfer_ds);
 				ast_channel_datastore_free(transfer_ds);
-				ast_channel_unlock(qe->chan);
-			}
+			}
+			ast_channel_unlock(qe->chan);
 		}
 
 		if (bridge != AST_PBX_NO_HANGUP_PEER)




More information about the asterisk-commits mailing list