[kill -15][AFTER_DESTROY]fix destroy threads for kill -15

This commit is contained in:
zhjc1124
2023-07-11 06:54:20 +00:00
committed by ob-robot
parent ca5d9652c4
commit a543a1c63f
12 changed files with 142 additions and 30 deletions

View File

@ -736,19 +736,37 @@ int ObDDLScheduler::start()
void ObDDLScheduler::stop()
{
TG_STOP(tg_id_);
TG_STOP(lib::TGDefIDs::DDLScanTask);
TG_STOP(lib::TGDefIDs::HeartBeatCheckTask);
task_queue_.set_stop(true);
idle_stop_ = true;
is_started_ = false;
if (is_inited_) {
TG_STOP(tg_id_);
TG_STOP(lib::TGDefIDs::DDLScanTask);
TG_STOP(lib::TGDefIDs::HeartBeatCheckTask);
task_queue_.set_stop(true);
idle_stop_ = true;
is_started_ = false;
}
}
void ObDDLScheduler::wait()
{
TG_WAIT(tg_id_);
TG_WAIT(lib::TGDefIDs::DDLScanTask);
TG_WAIT(lib::TGDefIDs::HeartBeatCheckTask);
if (is_inited_) {
TG_WAIT(tg_id_);
TG_WAIT(lib::TGDefIDs::DDLScanTask);
TG_WAIT(lib::TGDefIDs::HeartBeatCheckTask);
}
}
void ObDDLScheduler::destroy()
{
if (is_inited_) {
TG_DESTROY(tg_id_);
TG_DESTROY(lib::TGDefIDs::DDLScanTask);
TG_DESTROY(lib::TGDefIDs::HeartBeatCheckTask);
allocator_.destroy();
task_queue_.destroy();
root_service_ = nullptr;
tg_id_ = -1;
is_inited_ = false;
}
}
void ObDDLScheduler::run1()

View File

@ -216,6 +216,7 @@ public:
int start();
void stop();
void wait();
void destroy();
virtual void run1() override;
int create_ddl_task(