diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-01-27 19:52:53 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-01-27 19:52:53 +0100 |
commit | 804f3bfeafd922eceda856d9539e6ebc79e72b16 (patch) | |
tree | 152fd76fd4cf996ce2cdc2bcffca7feb59540382 /sql/threadpool_win.cc | |
parent | c5c32972ecf004fa2523c8f20171e6298ac97dc1 (diff) | |
download | mariadb-git-804f3bfeafd922eceda856d9539e6ebc79e72b16.tar.gz |
Threadpool : Rest of monty's review
Diffstat (limited to 'sql/threadpool_win.cc')
-rw-r--r-- | sql/threadpool_win.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/threadpool_win.cc b/sql/threadpool_win.cc index b4c73e6be63..e70d3c7edf0 100644 --- a/sql/threadpool_win.cc +++ b/sql/threadpool_win.cc @@ -652,12 +652,10 @@ static void CALLBACK shm_read_callback(PTP_CALLBACK_INSTANCE instance, */ void tp_add_connection(THD *thd) { - connection_t *con = (connection_t *)malloc(sizeof(connection_t)); - - if (con) - threads.append(thd); + threads.append(thd); mysql_mutex_unlock(&LOCK_thread_count); + connection_t *con = (connection_t *)malloc(sizeof(connection_t)); if(!con) { tp_log_warning("Allocation failed", "tp_add_connection"); @@ -667,6 +665,8 @@ void tp_add_connection(THD *thd) init_connection(con); con->thd= thd; + thd->event_scheduler.data= con; + /* Try to login asynchronously, using threads in the pool */ PTP_WORK wrk = CreateThreadpoolWork(login_callback,con, &con->callback_environ); if (wrk) @@ -720,4 +720,5 @@ void tp_wait_end(THD *thd) int tp_get_idle_thread_count() { return 0; -}
\ No newline at end of file +} + |