!32543 [Bugfix][PyNative] Coredump

Merge pull request !32543 from caifubi/master-pynative-async-coredump
This commit is contained in:
i-robot 2022-04-06 03:22:16 +00:00 committed by Gitee
commit 050a0e7052
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 3 additions and 2 deletions

View File

@ -112,7 +112,8 @@ bool OpExecutor::BuildQueueFull() {
return op_build_tasks_.size() > kMaxQueueSize;
}
bool OpExecutor::ActorInQueue(const std::string &actor_info) const {
bool OpExecutor::ActorInQueue(const std::string &actor_info) {
std::lock_guard<std::mutex> lock(task_mutex_);
auto iter = actor_in_queue_.find(actor_info);
return iter != actor_in_queue_.end();
}

View File

@ -66,7 +66,7 @@ class BACKEND_EXPORT OpExecutor {
// Determine if there is another task with the same name in execution.
// Tasks with the same name use the same CNode cache. So we need to wait.
bool ActorInQueue(const std::string &actor_info) const;
bool ActorInQueue(const std::string &actor_info);
// Wait for all OpRunTasks to finish executing.
void Wait();