~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/scheduler.h

  • Committer: Brian Aker
  • Date: 2008-07-14 22:40:46 UTC
  • Revision ID: brian@tangent.org-20080714224046-x183907w9wp1txwv
Removed sql_manager. Ever heard of just setting up the OS to sync when you
want it to?

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; version 2 of the License.
9
 
 *
10
 
 *  This program is distributed in the hope that it will be useful,
11
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 *  GNU General Public License for more details.
14
 
 *
15
 
 *  You should have received a copy of the GNU General Public License
16
 
 *  along with this program; if not, write to the Free Software
17
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 
 */
19
 
 
20
 
#ifndef DRIZZLE_SERVER_SCHEDULER_H
21
 
#define DRIZZLE_SERVER_SCHEDULER_H
 
1
/* Copyright (C) 2007 MySQL AB
 
2
 
 
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.
 
6
 
 
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.
 
11
 
 
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 */
22
15
 
23
16
/*
24
17
  Classes for the thread scheduler
25
18
*/
26
19
 
27
 
/* Forward declarations */
 
20
#ifdef USE_PRAGMA_INTERFACE
 
21
#pragma interface
 
22
#endif
 
23
 
28
24
class THD;
29
 
struct event;
30
25
 
31
26
/* Functions used when manipulating threads */
32
27
 
33
28
class scheduler_functions
34
29
{
35
30
public:
36
 
  uint32_t max_threads;
 
31
  uint max_threads;
37
32
  bool (*init)(void);
38
33
  bool (*init_new_connection_thread)(void);
39
34
  void (*add_connection)(THD *thd);
55
50
 
56
51
#define HAVE_POOL_OF_THREADS 1
57
52
 
 
53
struct event;
 
54
 
58
55
class thd_scheduler
59
56
{
60
57
public:
62
59
  struct event* io_event;
63
60
  LIST list;
64
61
  bool thread_attached;  /* Indicates if THD is attached to the OS thread */
65
 
 
 
62
  
66
63
  char dbug_explain_buf[256];
67
64
  void swap_dbug_explain();
68
65
 
69
66
  thd_scheduler();
70
67
  ~thd_scheduler();
71
 
  thd_scheduler(const thd_scheduler&);
72
 
  void operator=(const thd_scheduler&);
73
68
  bool init(THD* parent_thd);
74
69
  bool thread_attach();
75
70
  void thread_detach();
76
71
};
77
72
 
78
73
void pool_of_threads_scheduler(scheduler_functions* func);
79
 
 
80
 
#endif /* DRIZZLE_SERVER_SCHEDULER_H */