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 */
16
#ifndef DRIZZLE_SERVER_SCHEDULER_H
17
#define DRIZZLE_SERVER_SCHEDULER_H
20
Classes for the thread scheduler
23
/* Forward declarations */
27
/* Functions used when manipulating threads */
29
class scheduler_functions
34
bool (*init_new_connection_thread)(void);
35
void (*add_connection)(THD *thd);
36
void (*post_kill_notification)(THD *thd);
37
bool (*end_thread)(THD *thd, bool cache_thread);
39
scheduler_functions();
44
SCHEDULER_ONE_THREAD_PER_CONNECTION=0,
46
SCHEDULER_POOL_OF_THREADS
49
void one_thread_per_connection_scheduler(scheduler_functions* func);
50
void one_thread_scheduler(scheduler_functions* func);
52
#define HAVE_POOL_OF_THREADS 1
58
struct event* io_event;
60
bool thread_attached; /* Indicates if THD is attached to the OS thread */
62
char dbug_explain_buf[256];
63
void swap_dbug_explain();
67
bool init(THD* parent_thd);
72
void pool_of_threads_scheduler(scheduler_functions* func);
74
#endif /* DRIZZLE_SERVER_SCHEDULER_H */