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) {
{
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;
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;
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);
}
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);