summaryrefslogtreecommitdiff
path: root/sql/threadpool.h
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2012-01-15 15:41:25 +0100
committerVladislav Vaintroub <wlad@montyprogram.com>2012-01-15 15:41:25 +0100
commitd212991e892c366f6df96f8b52c8306ae329770f (patch)
treec89b92bccb4b1e84cf02db4eb46adae23222d703 /sql/threadpool.h
parent18c9b345b43b62b7c4dbac8ce0289c1c8103c2d1 (diff)
downloadmariadb-git-d212991e892c366f6df96f8b52c8306ae329770f.tar.gz
Get rid of idle thread counter atomic variable.
Instead, use function that loops over groups and calculates idle threads for "show status".
Diffstat (limited to 'sql/threadpool.h')
-rw-r--r--sql/threadpool.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/threadpool.h b/sql/threadpool.h
index 8c991aab2cb..78112b8b7bc 100644
--- a/sql/threadpool.h
+++ b/sql/threadpool.h
@@ -22,6 +22,9 @@ extern void tp_wait_end(THD*);
extern void tp_post_kill_notification(THD *thd);
extern void tp_end(void);
+/* Used in SHOW for threadpool_idle_thread_count */
+extern int tp_get_idle_thread_count();
+
/*
Threadpool statistics
*/
@@ -29,8 +32,6 @@ struct TP_STATISTICS
{
/* Current number of worker thread. */
volatile int32 num_worker_threads;
- /* Current number of idle threads. */
- volatile int32 num_waiting_threads;
};
extern TP_STATISTICS tp_stats;
@@ -45,3 +46,5 @@ extern void tp_set_threadpool_stall_limit(uint val);
/* Activate threadpool scheduler */
extern void tp_scheduler(void);
+extern int show_threadpool_idle_threads(THD *thd, SHOW_VAR *var, char *buff);
+