[asterisk-commits] mmichelson: branch mmichelson/queue_refcount r81358 - /team/mmichelson/queue_...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 29 15:13:32 CDT 2007


Author: mmichelson
Date: Wed Aug 29 15:13:31 2007
New Revision: 81358

URL: http://svn.digium.com/view/asterisk?view=rev&rev=81358
Log:
Updates to queue_refcount wrt realtime queues


Modified:
    team/mmichelson/queue_refcount/apps/app_queue.c

Modified: team/mmichelson/queue_refcount/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue_refcount/apps/app_queue.c?view=diff&rev=81358&r1=81357&r2=81358
==============================================================================
--- team/mmichelson/queue_refcount/apps/app_queue.c (original)
+++ team/mmichelson/queue_refcount/apps/app_queue.c Wed Aug 29 15:13:31 2007
@@ -1065,17 +1065,9 @@
 			ast_log(LOG_DEBUG, "Queue %s not found in realtime.\n", queuename);
 
 			q->dead = 1;
-			/* Delete if unused (else will be deleted when last caller leaves). */
-			if (!q->count) {
-				/* Delete. */
-				ast_mutex_unlock(&q->lock);
-				usleep(1);
-				ast_mutex_lock(&q->lock);
-				ast_mutex_unlock(&q->lock);
-				ao2_unlink(queues, q);
-				ao2_ref(q, -1);
-			} else
-				ast_mutex_unlock(&q->lock);
+			ast_mutex_unlock(&q->lock);
+			ao2_unlink(queues, q);
+			ao2_ref(q, -1);
 		}
 		return NULL;
 	}
@@ -1088,6 +1080,7 @@
 		clear_queue(q);
 		q->realtime = 1;
 		ao2_link(queues, q);
+		ao2_ref(q, 1);
 	}
 	init_queue(q);		/* Ensure defaults for all parameters not set explicitly. */
 
@@ -3920,7 +3913,6 @@
 						prev->next = next;
 					else
 						q->members = next;
-
 					remove_from_interfaces(cur->interface);
 					q->membercount--;
 					free(cur);




More information about the asterisk-commits mailing list