~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin_scheduling.h

Merged plugin-registration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#ifndef DRIZZLED_PLUGIN_SCHEDULING_H
24
24
#define DRIZZLED_PLUGIN_SCHEDULING_H
25
25
 
26
 
typedef struct scheduling_st
 
26
class Scheduler
27
27
{
 
28
private:
28
29
  uint32_t max_threads;
29
 
  uint32_t (*count)(void);
30
 
  bool (*init_new_connection_thread)(void);
31
 
  bool (*add_connection)(Session *session);
32
 
  void (*post_kill_notification)(Session *session);
33
 
  bool (*end_thread)(Session *session, bool cache_thread);
34
 
} scheduling_st;
 
30
public:
 
31
 
 
32
  Scheduler(uint32_t threads) : max_threads(threads) {}
 
33
 
 
34
  virtual ~Scheduler() {}
 
35
 
 
36
  uint32_t get_max_threads()
 
37
  {
 
38
    return max_threads;
 
39
  }
 
40
 
 
41
  virtual uint32_t count(void)= 0;
 
42
  virtual bool add_connection(Session *session)= 0;
 
43
 
 
44
  virtual bool end_thread(Session *, bool) {return false;}
 
45
  virtual bool init_new_connection_thread(void)
 
46
  {
 
47
    if (my_thread_init())
 
48
      return true;
 
49
    return false;
 
50
  }
 
51
 
 
52
  virtual void post_kill_notification(Session *) {}
 
53
};
35
54
 
36
55
#endif /* DRIZZLED_PLUGIN_SCHEDULING_H */