1
/* Copyright (C) 2007 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17
Classes for the thread scheduler
20
#ifdef USE_PRAGMA_INTERFACE
26
/* Functions used when manipulating threads */
28
class scheduler_functions
33
bool (*init_new_connection_thread)(void);
34
void (*add_connection)(THD *thd);
35
void (*post_kill_notification)(THD *thd);
36
bool (*end_thread)(THD *thd, bool cache_thread);
38
scheduler_functions();
43
SCHEDULER_ONE_THREAD_PER_CONNECTION=0,
45
SCHEDULER_POOL_OF_THREADS
48
void one_thread_per_connection_scheduler(scheduler_functions* func);
49
void one_thread_scheduler(scheduler_functions* func);
51
#define HAVE_POOL_OF_THREADS 1
59
struct event* io_event;
61
bool thread_attached; /* Indicates if THD is attached to the OS thread */
64
char dbug_explain_buf[256];
65
void swap_dbug_explain();
70
bool init(THD* parent_thd);
75
void pool_of_threads_scheduler(scheduler_functions* func);