~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pool_of_threads/pool_of_threads.cc

  • Committer: Brian Aker
  • Date: 2009-01-24 16:18:44 UTC
  • Revision ID: brian@gir-3.local-20090124161844-yeo4yhpw5d4ur780
Refactor of scheduler plugin code to simplify around one structure. Also
enhanced failure code for multi load attempts (and moved it out of
sql_plugin and just into the actual plugin container).

Set pool_of_threads to be default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
static uint32_t created_threads, killed_threads;
30
30
static bool kill_pool_threads;
 
31
static bool isEnabled= true;
31
32
 
32
33
static struct event session_add_event;
33
34
static struct event session_kill_event;
554
555
 
555
556
static int init(void *p)
556
557
{
557
 
  scheduler_functions* func= (scheduler_functions *)p;
 
558
  scheduling_st* func= (scheduling_st *)p;
 
559
 
 
560
  if (isEnabled == false)
 
561
  {
 
562
    func->is_used= false;
 
563
    return 0;
 
564
  }
 
565
  func->is_used= true;
558
566
 
559
567
  assert(size != 0);
560
568
  func->max_threads= size;
579
587
                           N_("Size of Pool."),
580
588
                           NULL, NULL, 8, 1, 1024, 0);
581
589
 
 
590
static DRIZZLE_SYSVAR_BOOL(enabled, isEnabled,
 
591
                           PLUGIN_VAR_NOCMDARG,
 
592
                           N_("Enable Pool of Threads Scheduler"),
 
593
                           NULL, /* check func */
 
594
                           NULL, /* update func */
 
595
                           true /* default */);
 
596
 
582
597
static struct st_mysql_sys_var* system_variables[]= {
583
598
  DRIZZLE_SYSVAR(size),
 
599
  DRIZZLE_SYSVAR(enabled),
584
600
  NULL,
585
601
};
586
602