diff options
author | andrey@fifo.vaih.whnetz <> | 2006-08-31 17:18:39 +0200 |
---|---|---|
committer | andrey@fifo.vaih.whnetz <> | 2006-08-31 17:18:39 +0200 |
commit | 7b5916a26c2bb4f44c9bfc8a68f6b81949a1b293 (patch) | |
tree | 7578f63a766b0ce331cbafad99ef748c185822f1 /sql/event_queue.h | |
parent | fffe4e97be40c1c20edda0ab9a32e3afd2f28ae0 (diff) | |
download | mariadb-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_queue.h')
-rw-r--r-- | sql/event_queue.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sql/event_queue.h b/sql/event_queue.h index afb9babc572..73d1a3efe4d 100644 --- a/sql/event_queue.h +++ b/sql/event_queue.h @@ -36,7 +36,7 @@ public: deinit_mutexes(); bool - init_queue(THD *thd, Event_db_repository *db_repo, Event_scheduler *sched); + init_queue(THD *thd, Event_db_repository *db_repo); void deinit_queue(); @@ -60,8 +60,7 @@ public: recalculate_activation_times(THD *thd); bool - get_top_for_execution_if_time(THD *thd, time_t now, Event_job_data **job_data, - struct timespec *abstime); + get_top_for_execution_if_time(THD *thd, Event_job_data **job_data); bool dump_internal_status(THD *thd); @@ -81,13 +80,11 @@ protected: empty_queue(); void - notify_observers(); - - void dbug_dump_queue(time_t now); /* LOCK_event_queue is the mutex which protects the access to the queue. */ pthread_mutex_t LOCK_event_queue; + pthread_cond_t COND_queue_state; Event_db_repository *db_repository; @@ -96,6 +93,8 @@ protected: /* The sorted queue with the Event_job_data objects */ QUEUE queue; + TIME next_activation_at; + uint mutex_last_locked_at_line; uint mutex_last_unlocked_at_line; uint mutex_last_attempted_lock_at_line; @@ -104,6 +103,7 @@ protected: const char* mutex_last_attempted_lock_in_func; bool mutex_queue_data_locked; bool mutex_queue_data_attempting_lock; + bool waiting_on_cond; /* helper functions for working with mutexes & conditionals */ void @@ -111,6 +111,10 @@ protected: void unlock_data(const char *func, uint line); + + void + cond_wait(THD *thd, struct timespec *abstime, const char* msg, + const char *func, uint line); }; #endif /* _EVENT_QUEUE_H_ */ |