summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2012-01-24 03:23:14 +0100
committerVladislav Vaintroub <wlad@montyprogram.com>2012-01-24 03:23:14 +0100
commitd50649ecf787d4adf80544e892a00a709db37f32 (patch)
treeda2bb539c5abd8fb2103b0eb049f4c43e3b12218
parentb1422b8f1b2e93de2ec548c81df5609dd5996515 (diff)
downloadmariadb-git-d50649ecf787d4adf80544e892a00a709db37f32.tar.gz
small cleanups
-rw-r--r--sql/scheduler.h20
-rw-r--r--sql/sql_parse.cc1
-rw-r--r--sql/threadpool.h6
-rw-r--r--sql/threadpool_common.cc3
-rw-r--r--sql/threadpool_unix.cc2
-rw-r--r--sql/threadpool_win.cc7
6 files changed, 12 insertions, 27 deletions
diff --git a/sql/scheduler.h b/sql/scheduler.h
index c91df8512ab..302ccd7ab11 100644
--- a/sql/scheduler.h
+++ b/sql/scheduler.h
@@ -95,26 +95,8 @@ public:
*/
PSI_thread *m_psi;
void *data; /* scheduler-specific data structure */
-#ifndef DBUG_OFF
- bool set_explain;
- char dbug_explain[512];
-#endif
};
-void *thd_get_scheduler_data(THD *thd);
-void thd_set_scheduler_data(THD *thd, void *data);
-PSI_thread* thd_get_psi(THD *thd);
-void thd_set_psi(THD *thd, PSI_thread *psi);
-
-/* Common thread pool routines, suitable for different implementations */
-extern void threadpool_remove_connection(THD *thd);
-extern int threadpool_process_request(THD *thd);
-extern int threadpool_add_connection(THD *thd);
-
-
-extern scheduler_functions *thread_scheduler;
-#endif /* SCHEDULER_INCLUDED */
-
#if !defined(EMBEDDED_LIBRARY)
#define HAVE_POOL_OF_THREADS 1
void pool_of_threads_scheduler(scheduler_functions* func,
@@ -124,3 +106,5 @@ void pool_of_threads_scheduler(scheduler_functions* func,
#define pool_of_threads_scheduler(A,B,C) \
one_thread_per_connection_scheduler(A, B, C)
#endif
+
+#endif /* SCHEDULER_INCLUDED */
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 2ea94e55eda..c0792b2c342 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -683,7 +683,6 @@ void cleanup_items(Item *item)
@retval
1 request of thread shutdown (see dispatch_command() description)
*/
-int skip_net_wait_timeout = 0;
bool do_command(THD *thd)
{
diff --git a/sql/threadpool.h b/sql/threadpool.h
index 78112b8b7bc..2b0d09c0d6d 100644
--- a/sql/threadpool.h
+++ b/sql/threadpool.h
@@ -10,6 +10,12 @@ extern uint threadpool_max_threads; /* Maximum threads in pool */
extern uint threadpool_oversubscribe; /* Maximum active threads in group */
+
+/* Common thread pool routines, suitable for different implementations */
+extern void threadpool_remove_connection(THD *thd);
+extern int threadpool_process_request(THD *thd);
+extern int threadpool_add_connection(THD *thd);
+
/*
Functions used by scheduler.
OS-specific implementations are in
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc
index 5152f62efe9..dc8ef9f6cfd 100644
--- a/sql/threadpool_common.cc
+++ b/sql/threadpool_common.cc
@@ -19,6 +19,9 @@ uint threadpool_stall_limit;
uint threadpool_max_threads;
uint threadpool_oversubscribe;
+/* Stats */
+TP_STATISTICS tp_stats;
+
extern "C" pthread_key(struct st_my_thread_var*, THR_KEY_mysys);
extern bool do_command(THD*);
diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc
index d0a6b0d8a08..5dcc9d4420c 100644
--- a/sql/threadpool_unix.cc
+++ b/sql/threadpool_unix.cc
@@ -60,8 +60,6 @@ static PSI_thread_info thread_list[] =
#define PSI_register(X) \
if(PSI_server) PSI_server->register_ ## X("threadpool", X ## _list, array_elements(X ## _list))
-
-TP_STATISTICS tp_stats;
struct thread_group_t;
diff --git a/sql/threadpool_win.cc b/sql/threadpool_win.cc
index 1a560e62301..7a2c8c0c6cf 100644
--- a/sql/threadpool_win.cc
+++ b/sql/threadpool_win.cc
@@ -17,9 +17,6 @@
#include <windows.h>
-
-TP_STATISTICS tp_stats;
-
#define WEAK_SYMBOL(return_type, function, ...) \
typedef return_type (WINAPI *pFN_##function)(__VA_ARGS__); \
static pFN_##function my_##function = (pFN_##function) \
@@ -136,7 +133,6 @@ static void tp_log_warning(const char *msg, const char *fct)
PTP_POOL pool;
DWORD fls;
-extern int skip_net_wait_timeout;
static bool skip_completion_port_on_success = false;
@@ -544,7 +540,7 @@ void tp_end(void)
This would not be necessary if CloseThreadpool() would synchronously
release all threads and wait until they disappear and call all their FLS
- destrructors . However, threads in the pool are released asynchronously
+ destructors . However, threads in the pool are released asynchronously
and might spend some time in the CRT shutdown code. Thus zero
num_worker_threads, to avoid thread destructor's my_thread_end()s after
this point.
@@ -560,7 +556,6 @@ void tp_end(void)
mysql_mutex_unlock(&THR_LOCK_threads);
}
}
- skip_net_wait_timeout= 0;
}
/*