~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to sql/scheduler.h

  • Committer: Monty Taylor
  • Date: 2008-07-05 11:20:18 UTC
  • mto: This revision was merged to the branch mainline in revision 62.
  • Revision ID: monty@inaugust.com-20080705112018-fr12kkmgphtu7m29
Changes so that removal of duplicate curr_dir from my_sys.h work.

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
  
 
63
#ifndef DBUG_OFF
66
64
  char dbug_explain_buf[256];
67
65
  void swap_dbug_explain();
 
66
#endif
68
67
 
69
68
  thd_scheduler();
70
69
  ~thd_scheduler();
71
 
  thd_scheduler(const thd_scheduler&);
72
 
  void operator=(const thd_scheduler&);
73
70
  bool init(THD* parent_thd);
74
71
  bool thread_attach();
75
72
  void thread_detach();
76
73
};
77
74
 
78
75
void pool_of_threads_scheduler(scheduler_functions* func);
79
 
 
80
 
#endif /* DRIZZLE_SERVER_SCHEDULER_H */