~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/scheduler.h

  • Committer: Monty Taylor
  • Date: 2008-10-22 21:31:15 UTC
  • Revision ID: monty@inaugust.com-20081022213115-xuxc80r939tl88p1
Renamed drizzle_common again. Removed sql_common. (empty) 
Now all we need to do is merge/disect base.h, common.h, common_includes.h, server_includes.h and globa.h (good grief)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
*/
26
26
 
27
27
/* Forward declarations */
28
 
class THD;
 
28
class Session;
29
29
struct event;
30
30
 
31
31
/* Functions used when manipulating threads */
36
36
  uint32_t max_threads;
37
37
  bool (*init)(void);
38
38
  bool (*init_new_connection_thread)(void);
39
 
  void (*add_connection)(THD *thd);
40
 
  void (*post_kill_notification)(THD *thd);
41
 
  bool (*end_thread)(THD *thd, bool cache_thread);
 
39
  void (*add_connection)(Session *session);
 
40
  void (*post_kill_notification)(Session *session);
 
41
  bool (*end_thread)(Session *session, bool cache_thread);
42
42
  void (*end)(void);
43
43
  scheduler_functions();
44
44
};
45
45
 
46
46
enum scheduler_types
47
47
{
48
 
  SCHEDULER_ONE_THREAD_PER_CONNECTION=0,
49
 
  SCHEDULER_NO_THREADS,
50
48
  SCHEDULER_POOL_OF_THREADS
51
49
};
52
50
 
55
53
 
56
54
#define HAVE_POOL_OF_THREADS 1
57
55
 
58
 
class thd_scheduler
 
56
class session_scheduler
59
57
{
60
58
public:
61
59
  bool logged_in;
62
60
  struct event* io_event;
63
61
  LIST list;
64
 
  bool thread_attached;  /* Indicates if THD is attached to the OS thread */
65
 
  
66
 
  char dbug_explain_buf[256];
67
 
  void swap_dbug_explain();
 
62
  bool thread_attached;  /* Indicates if Session is attached to the OS thread */
68
63
 
69
 
  thd_scheduler();
70
 
  ~thd_scheduler();
71
 
  bool init(THD* parent_thd);
 
64
  session_scheduler();
 
65
  ~session_scheduler();
 
66
  session_scheduler(const session_scheduler&);
 
67
  void operator=(const session_scheduler&);
 
68
  bool init(Session* parent_session);
72
69
  bool thread_attach();
73
70
  void thread_detach();
74
71
};