mirror of
https://github.com/MariaDB/server.git
synced 2026-04-24 09:15:30 +02:00
Make event stop code even more robust.
(Test failed if we added my_sleep(200000) in event_queue::cond_wait() just before pthread_cond_wait(); Not likely scenario but better to get that fixed too)
This commit is contained in:
parent
4cb68c0e89
commit
8882d71f3f
1 changed files with 8 additions and 1 deletions
|
|
@ -648,7 +648,14 @@ Event_scheduler::stop()
|
|||
/* thd could be 0x0, when shutting down */
|
||||
sql_print_information("Event Scheduler: "
|
||||
"Waiting for the scheduler thread to reply");
|
||||
COND_STATE_WAIT(thd, NULL, "Waiting scheduler to stop");
|
||||
|
||||
/*
|
||||
Wait only 2 seconds, as there is a small chance the thread missed the
|
||||
above awake() call and we may have to do it again
|
||||
*/
|
||||
struct timespec top_time;
|
||||
set_timespec(top_time, 2);
|
||||
COND_STATE_WAIT(thd, &top_time, "Waiting scheduler to stop");
|
||||
} while (state == STOPPING);
|
||||
DBUG_PRINT("info", ("Scheduler thread has cleaned up. Set state to INIT"));
|
||||
sql_print_information("Event Scheduler: Stopped");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue