summaryrefslogtreecommitdiff
path: root/sql/event_scheduler.h
diff options
context:
space:
mode:
authorandrey@fifo.vaih.whnetz <>2006-08-31 17:18:39 +0200
committerandrey@fifo.vaih.whnetz <>2006-08-31 17:18:39 +0200
commit7b5916a26c2bb4f44c9bfc8a68f6b81949a1b293 (patch)
tree7578f63a766b0ce331cbafad99ef748c185822f1 /sql/event_scheduler.h
parentfffe4e97be40c1c20edda0ab9a32e3afd2f28ae0 (diff)
downloadmariadb-git-7b5916a26c2bb4f44c9bfc8a68f6b81949a1b293.tar.gz
WL#3337 (Event scheduler new architecture)
This patch makes the relationship between Event_scheduler and Event_queue unidirectional from the former to the latter. The change is that the conditional on which the scheduler sleeped has been moved to the Event_queue and the latter does not call anymore Event_scheduler::queue_changed(), which in turn has be removed.
Diffstat (limited to 'sql/event_scheduler.h')
-rw-r--r--sql/event_scheduler.h33
1 files changed, 12 insertions, 21 deletions
diff --git a/sql/event_scheduler.h b/sql/event_scheduler.h
index 18a805eb6f6..fc41e345dfd 100644
--- a/sql/event_scheduler.h
+++ b/sql/event_scheduler.h
@@ -34,14 +34,6 @@ public:
Event_scheduler():state(UNINITIALIZED){}
~Event_scheduler(){}
- enum enum_state
- {
- UNINITIALIZED = 0,
- INITIALIZED,
- RUNNING,
- STOPPING
- };
-
/* State changing methods follow */
bool
@@ -70,12 +62,8 @@ public:
deinit_mutexes();
/* Information retrieving methods follow */
-
- enum enum_state
- get_state();
-
- void
- queue_changed();
+ bool
+ is_running();
bool
dump_internal_status(THD *thd);
@@ -84,6 +72,7 @@ private:
uint
workers_count();
+
/* helper functions */
bool
execute_top(THD *thd, Event_job_data *job_data);
@@ -101,16 +90,18 @@ private:
pthread_mutex_t LOCK_scheduler_state;
+ enum enum_state
+ {
+ UNINITIALIZED = 0,
+ INITIALIZED,
+ RUNNING,
+ STOPPING
+ };
+
/* This is the current status of the life-cycle of the scheduler. */
enum enum_state state;
- /*
- Holds the thread id of the executor thread or 0 if the scheduler is not
- running. It is used by ::shutdown() to know which thread to kill with
- kill_one_thread(). The latter wake ups a thread if it is waiting on a
- conditional variable and sets thd->killed to non-zero.
- */
- ulong thread_id;
+ THD *scheduler_thd;
pthread_cond_t COND_state;