Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
run cleanup in engine shutdown phase
Browse files Browse the repository at this point in the history
  • Loading branch information
arcadiaphy committed Feb 22, 2019
1 parent e0b4d17 commit d85ee88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/engine/threaded_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void ThreadedEngine::DeleteOperator(OprHandle op) {
this->PushAsync([threaded_opr](RunContext, CallbackOnComplete on_complete) {
ThreadedOpr::Delete(threaded_opr);
on_complete();
}, Context::CPU(), {}, deps, FnProperty::kAsync, 0,
}, Context::CPU(), {}, deps, FnProperty::kDeleteVar, 0,
"DeleteOperator");
}

Expand Down
3 changes: 2 additions & 1 deletion src/engine/threaded_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ class ThreadedEngine : public Engine {
LOG(INFO) << "ExecuteOprBlock " << opr_block
<< "shutdown_phase=" << shutdown_phase_;
}
if (!shutdown_phase_) {
// still run cleanup in shutdown_phase
if (!shutdown_phase_ || threaded_opr->prop == FnProperty::kDeleteVar) {
try {
OnStart(threaded_opr);
if (debug_info) {
Expand Down

0 comments on commit d85ee88

Please sign in to comment.