~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

Merged plugin-registration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
#include <drizzled/item/create.h>
45
45
#include <drizzled/errmsg.h>
46
46
#include <drizzled/unireg.h>
47
 
#include <drizzled/plugin_scheduling.h>
 
47
#include <drizzled/scheduling.h>
48
48
#include "drizzled/temporal_format.h" /* For init_temporal_formats() */
49
49
 
50
50
#if TIME_WITH_SYS_TIME
421
421
static pthread_t select_thread;
422
422
static uint32_t thr_kill_signal;
423
423
 
424
 
extern scheduling_st thread_scheduler;
425
 
 
426
424
/**
427
425
  Number of currently active user connections. The variable is protected by
428
426
  LOCK_thread_count.
496
494
  */
497
495
 
498
496
  Session *tmp;
 
497
  Scheduler &thread_scheduler= get_thread_scheduler();
 
498
 
499
499
  (void) pthread_mutex_lock(&LOCK_thread_count); // For unlink from list
500
500
 
501
501
  I_List_iterator<Session> it(session_list);
939
939
  if (session)
940
940
  {
941
941
    statistic_increment(killed_threads, &LOCK_status);
942
 
    (void)thread_scheduler.end_thread(session, 0);              /* purecov: inspected */
 
942
    Scheduler &thread_scheduler= get_thread_scheduler();
 
943
    (void)thread_scheduler.end_thread(session, 0);
943
944
  }
944
 
  return;;                              /* purecov: deadcode */
 
945
  return;                               /* purecov: deadcode */
945
946
}
946
947
 
947
948
 
1023
1024
  }
1024
1025
 
1025
1026
  localtime_r(&curr_time, &tm);
1026
 
 
 
1027
  Scheduler &thread_scheduler= get_thread_scheduler();
 
1028
  
1027
1029
  fprintf(stderr,"%02d%02d%02d %2d:%02d:%02d - drizzled got "
1028
1030
          SIGNAL_FMT " ;\n"
1029
1031
          "This could be because you hit a bug. It is also possible that "
1041
1043
          (uint32_t) dflt_key_cache->key_cache_mem_size);
1042
1044
  fprintf(stderr, "read_buffer_size=%ld\n", (long) global_system_variables.read_buff_size);
1043
1045
  fprintf(stderr, "max_used_connections=%u\n", max_used_connections);
1044
 
  fprintf(stderr, "max_threads=%u\n", thread_scheduler.max_threads);
 
1046
  fprintf(stderr, "max_threads=%u\n", thread_scheduler.get_max_threads());
1045
1047
  fprintf(stderr, "thread_count=%u\n", thread_scheduler.count());
1046
1048
  fprintf(stderr, "connection_count=%u\n", uint32_t(connection_count));
1047
1049
  fprintf(stderr, _("It is possible that drizzled could use up to \n"
1053
1055
          (uint64_t)(((uint32_t) dflt_key_cache->key_cache_mem_size +
1054
1056
                     (global_system_variables.read_buff_size +
1055
1057
                      global_system_variables.sortbuff_size) *
1056
 
                     thread_scheduler.max_threads) / 1024));
 
1058
                     thread_scheduler.get_max_threads()) / 1024));
1057
1059
 
1058
1060
#ifdef HAVE_STACKTRACE
1059
1061
  Session *session= current_session;
1839
1841
 
1840
1842
static void create_new_thread(Session *session)
1841
1843
{
 
1844
  Scheduler &thread_scheduler= get_thread_scheduler();
 
1845
 
1842
1846
  ++connection_count;
1843
1847
 
1844
1848
  if (connection_count > max_used_connections)