summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2006-09-15 18:18:18 -0400
committerunknown <cmiller@zippy.cornsilk.net>2006-09-15 18:18:18 -0400
commit0dfa6c953a14cd2ce1b3b953caf1972276397fc3 (patch)
tree21d4e1df40c310e8e9f459e0c6663efef61e7586 /sql/mysqld.cc
parent39f28ab6c5c92eca8761359835acd81b5fb73a6f (diff)
parent7d131bcde2b28d49889c83d870feafe8dd18f8d9 (diff)
downloadmariadb-git-0dfa6c953a14cd2ce1b3b953caf1972276397fc3.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint BitKeeper/etc/ignore: auto-union mysql-test/mysql-test-run.pl: Auto merged sql/mysqld.cc: Auto merged sql/share/errmsg.txt: Auto merged sql/sql_class.h: Auto merged sql/sql_parse.cc: Auto merged
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc43
1 files changed, 27 insertions, 16 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 00056a4c261..f099ff76720 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -837,7 +837,7 @@ static void close_connections(void)
DBUG_PRINT("quit",("Informing thread %ld that it's time to die",
tmp->thread_id));
/* We skip slave threads & scheduler on this first loop through. */
- if (tmp->slave_thread || tmp->system_thread == SYSTEM_THREAD_EVENT_SCHEDULER)
+ if (tmp->slave_thread)
continue;
tmp->killed= THD::KILL_CONNECTION;
@@ -856,7 +856,7 @@ static void close_connections(void)
}
(void) pthread_mutex_unlock(&LOCK_thread_count); // For unlink from list
- Events::shutdown();
+ Events::get_instance()->deinit();
end_slave();
if (thread_count)
@@ -1294,7 +1294,7 @@ static void clean_up_mutexes()
(void) pthread_mutex_destroy(&LOCK_bytes_sent);
(void) pthread_mutex_destroy(&LOCK_bytes_received);
(void) pthread_mutex_destroy(&LOCK_user_conn);
- Events::destroy_mutexes();
+ Events::get_instance()->destroy_mutexes();
#ifdef HAVE_OPENSSL
(void) pthread_mutex_destroy(&LOCK_des_key_file);
#ifndef HAVE_YASSL
@@ -2872,7 +2872,7 @@ static int init_thread_environment()
(void) pthread_mutex_init(&LOCK_server_started, MY_MUTEX_INIT_FAST);
(void) pthread_cond_init(&COND_server_started,NULL);
sp_cache_init();
- Events::init_mutexes();
+ Events::get_instance()->init_mutexes();
/* Parameter for threads created for connections */
(void) pthread_attr_init(&connection_attrib);
(void) pthread_attr_setdetachstate(&connection_attrib,
@@ -3658,7 +3658,8 @@ we force server id to 2, but this MySQL server will not act as a slave.");
if (!opt_noacl)
{
- Events::init();
+ if (Events::get_instance()->init())
+ unireg_abort(1);
}
#if defined(__NT__) || defined(HAVE_SMEM)
handle_connections_methods();
@@ -5001,9 +5002,9 @@ struct my_option my_long_options[] =
(gptr*) &global_system_variables.engine_condition_pushdown,
(gptr*) &global_system_variables.engine_condition_pushdown,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ /* See how it's handled in get_one_option() */
{"event-scheduler", OPT_EVENT_SCHEDULER, "Enable/disable the event scheduler.",
- (gptr*) &Events::opt_event_scheduler, (gptr*) &Events::opt_event_scheduler, 0, GET_ULONG,
- REQUIRED_ARG, 2/*default*/, 0/*min-value*/, 2/*max-value*/, 0, 0, 0},
+ NULL, NULL, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"exit-info", 'T', "Used for debugging; Use at your own risk!", 0, 0, 0,
GET_LONG, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"external-locking", OPT_USE_LOCKING, "Use system (external) locking (disabled by default). With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running. Disable with --skip-external-locking.",
@@ -7305,20 +7306,30 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
#endif
case OPT_EVENT_SCHEDULER:
if (!argument)
- Events::opt_event_scheduler= 2;
+ Events::opt_event_scheduler= Events::EVENTS_DISABLED;
else
{
int type;
- if ((type=find_type(argument, &Events::opt_typelib, 1)) <= 0)
- {
- fprintf(stderr,"Unknown option to event-scheduler: %s\n",argument);
- exit(1);
- }
/*
- type= 1 2 3 4 5 6
- (OFF | 0) - (ON | 1) - (2 | SUSPEND)
+ type= 5 1 2 3 4
+ (DISABLE ) - (OFF | ON) - (0 | 1)
*/
- Events::opt_event_scheduler= (type-1) / 2;
+ switch ((type=find_type(argument, &Events::opt_typelib, 1))) {
+ case 0:
+ fprintf(stderr, "Unknown option to event-scheduler: %s\n",argument);
+ exit(1);
+ case 5: /* OPT_DISABLED */
+ Events::opt_event_scheduler= Events::EVENTS_DISABLED;
+ break;
+ case 2: /* OPT_ON */
+ case 4: /* 1 */
+ Events::opt_event_scheduler= Events::EVENTS_ON;
+ break;
+ case 1: /* OPT_OFF */
+ case 3: /* 0 */
+ Events::opt_event_scheduler= Events::EVENTS_OFF;
+ break;
+ }
}
break;
case (int) OPT_SKIP_NEW: