~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/drizzled.cc

  • 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:
322
322
ulong refresh_version;  /* Increments on each reload */
323
323
query_id_t global_query_id;
324
324
ulong aborted_threads, aborted_connects;
325
 
ulong flush_time;
326
325
ulong specialflag=0;
327
326
ulong binlog_cache_use= 0, binlog_cache_disk_use= 0;
328
327
ulong max_connections, max_connect_errors;
533
532
  kill_cached_threads++;
534
533
  flush_thread_cache();
535
534
 
536
 
  /* kill flush thread */
537
 
  (void) pthread_mutex_lock(&LOCK_manager);
538
 
  if (manager_thread_in_use)
539
 
  {
540
 
   (void) pthread_cond_signal(&COND_manager);
541
 
  }
542
 
  (void) pthread_mutex_unlock(&LOCK_manager);
543
 
 
544
535
  /* kill connection thread */
545
536
  (void) pthread_mutex_lock(&LOCK_thread_count);
546
537
 
921
912
  (void) pthread_mutex_destroy(&LOCK_mapped_file);
922
913
  (void) pthread_mutex_destroy(&LOCK_status);
923
914
  (void) pthread_mutex_destroy(&LOCK_error_log);
924
 
  (void) pthread_mutex_destroy(&LOCK_manager);
925
915
  (void) pthread_mutex_destroy(&LOCK_crypt);
926
916
  (void) pthread_mutex_destroy(&LOCK_user_conn);
927
917
  (void) pthread_mutex_destroy(&LOCK_connection_count);
939
929
  (void) pthread_cond_destroy(&COND_global_read_lock);
940
930
  (void) pthread_cond_destroy(&COND_thread_cache);
941
931
  (void) pthread_cond_destroy(&COND_flush_thread_cache);
942
 
  (void) pthread_cond_destroy(&COND_manager);
943
932
}
944
933
 
945
934
 
2298
2287
  (void) pthread_mutex_init(&LOCK_mapped_file,MY_MUTEX_INIT_SLOW);
2299
2288
  (void) pthread_mutex_init(&LOCK_status,MY_MUTEX_INIT_FAST);
2300
2289
  (void) pthread_mutex_init(&LOCK_error_log,MY_MUTEX_INIT_FAST);
2301
 
  (void) pthread_mutex_init(&LOCK_manager,MY_MUTEX_INIT_FAST);
2302
2290
  (void) pthread_mutex_init(&LOCK_crypt,MY_MUTEX_INIT_FAST);
2303
2291
  (void) pthread_mutex_init(&LOCK_user_conn, MY_MUTEX_INIT_FAST);
2304
2292
  (void) pthread_mutex_init(&LOCK_active_mi, MY_MUTEX_INIT_FAST);
2314
2302
  (void) pthread_cond_init(&COND_global_read_lock,NULL);
2315
2303
  (void) pthread_cond_init(&COND_thread_cache,NULL);
2316
2304
  (void) pthread_cond_init(&COND_flush_thread_cache,NULL);
2317
 
  (void) pthread_cond_init(&COND_manager,NULL);
2318
2305
  (void) pthread_mutex_init(&LOCK_rpl_status, MY_MUTEX_INIT_FAST);
2319
2306
  (void) pthread_cond_init(&COND_rpl_status, NULL);
2320
2307
 
2612
2599
}
2613
2600
 
2614
2601
 
2615
 
static void create_maintenance_thread()
2616
 
{
2617
 
  if (flush_time && flush_time != ~(ulong) 0L)
2618
 
  {
2619
 
    pthread_t hThread;
2620
 
    if (pthread_create(&hThread,&connection_attrib,handle_manager,0))
2621
 
      sql_print_warning("Can't create thread to manage maintenance");
2622
 
  }
2623
 
}
2624
 
 
2625
 
 
2626
2602
int main(int argc, char **argv)
2627
2603
{
2628
2604
  MY_INIT(argv[0]);             // init my_sys library & pthreads
2758
2734
    unireg_abort(1);
2759
2735
  }
2760
2736
 
2761
 
  create_maintenance_thread();
2762
 
 
2763
2737
  sql_print_information(ER(ER_STARTUP),my_progname,server_version,
2764
2738
                        "", mysqld_port, MYSQL_COMPILATION_COMMENT);
2765
2739
 
3636
3610
   (char**) &expire_logs_days,
3637
3611
   (char**) &expire_logs_days, 0, GET_ULONG,
3638
3612
   REQUIRED_ARG, 0, 0, 99, 0, 1, 0},
3639
 
  { "flush_time", OPT_FLUSH_TIME,
3640
 
    "A dedicated thread is created to flush all tables at the given interval.",
3641
 
    (char**) &flush_time, (char**) &flush_time, 0, GET_ULONG, REQUIRED_ARG,
3642
 
    FLUSH_TIME, 0, LONG_TIMEOUT, 0, 1, 0},
3643
3613
  { "group_concat_max_len", OPT_GROUP_CONCAT_MAX_LEN,
3644
3614
    "The maximum length of the result of function  group_concat.",
3645
3615
    (char**) &global_system_variables.group_concat_max_len,
4683
4653
    if (opt_console)
4684
4654
      opt_error_log= 0;                 // Force logs to stdout
4685
4655
    break;
4686
 
  case (int) OPT_FLUSH:
4687
 
    myisam_flush=1;
4688
 
    flush_time=0;                       // No auto flush
4689
 
    break;
4690
4656
  case OPT_LOW_PRIORITY_UPDATES:
4691
4657
    thr_upgraded_concurrent_insert_lock= TL_WRITE_LOW_PRIORITY;
4692
4658
    global_system_variables.low_priority_updates=1;