[asterisk-commits] mmichelson: branch mmichelson/threadpool r377476 - /team/mmichelson/threadpoo...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Dec 9 13:10:18 CST 2012


Author: mmichelson
Date: Sun Dec  9 13:10:14 2012
New Revision: 377476

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=377476
Log:
Remove unnecessary debugging and add some useful debugging.


Modified:
    team/mmichelson/threadpool/main/threadpool.c

Modified: team/mmichelson/threadpool/main/threadpool.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/threadpool/main/threadpool.c?view=diff&rev=377476&r1=377475&r2=377476
==============================================================================
--- team/mmichelson/threadpool/main/threadpool.c (original)
+++ team/mmichelson/threadpool/main/threadpool.c Sun Dec  9 13:10:14 2012
@@ -511,6 +511,9 @@
 static void grow(struct ast_threadpool *pool, int delta)
 {
 	int i;
+
+	ast_debug(1, "Going to increase threadpool size by %d\n", delta);
+
 	for (i = 0; i < delta; ++i) {
 		struct worker_thread *worker = worker_thread_alloc(pool);
 		if (!worker) {
@@ -537,11 +540,8 @@
 {
 	int *num_to_kill = arg;
 
-	ast_log(LOG_NOTICE, "num to kill is %d\n", *num_to_kill);
-
 	if (*num_to_kill > 0) {
 		--(*num_to_kill);
-		ast_log(LOG_NOTICE, "Should be killing a thread\n");
 		return CMP_MATCH;
 	} else {
 		return CMP_STOP;
@@ -574,7 +574,6 @@
 	int *num_to_zombify = data;
 
 	if ((*num_to_zombify)-- > 0) {
-		ast_log(LOG_NOTICE, "Should be zombifying a thread\n");
 		ao2_link(pool->zombie_threads, worker);
 		worker_set_state(worker, ZOMBIE);
 		return CMP_MATCH;
@@ -606,9 +605,12 @@
 	int idle_threads_to_kill = MIN(delta, idle_threads);
 	int active_threads_to_zombify = delta - idle_threads_to_kill;
 
-	ast_log(LOG_NOTICE, "Going to kill off %d idle threads\n", idle_threads_to_kill);
+	ast_debug(1, "Going to kill off %d idle threads\n", idle_threads_to_kill);
+
 	ao2_callback(pool->idle_threads, OBJ_UNLINK | OBJ_NOLOCK | OBJ_NODATA | OBJ_MULTIPLE,
 			kill_threads, &idle_threads_to_kill);
+
+	ast_debug(1, "Goign to kill off %d active threads\n", active_threads_to_zombify);
 
 	ao2_callback_data(pool->active_threads, OBJ_UNLINK | OBJ_NOLOCK | OBJ_NODATA | OBJ_MULTIPLE,
 			zombify_threads, pool, &active_threads_to_zombify);
@@ -735,7 +737,6 @@
 
 	pool = tps_listener->private_data;
 	pool->tps = tps;
-	ast_log(LOG_NOTICE, "The taskprocessor I've created is located at %p\n", pool->tps);
 	ao2_ref(listener, +1);
 	pool->listener = listener;
 	ast_threadpool_set_size(pool, initial_size);




More information about the asterisk-commits mailing list