!45858 [MS][LITE][RUNNER] bugfix

Merge pull request !45858 from yefeng/469-fix_bug
This commit is contained in:
i-robot 2022-11-23 09:28:43 +00:00 committed by Gitee
commit 255fe929e5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 12 additions and 0 deletions

View File

@ -68,6 +68,10 @@ public class ModelParallelRunner {
rwLock.writeLock().unlock(); rwLock.writeLock().unlock();
return false; return false;
} }
if (modelParallelRunnerPtr != 0L){
rwLock.writeLock().unlock();
return true;
}
modelParallelRunnerPtr = this.init(modelPath, runnerConfig.getRunnerConfigPtr()); modelParallelRunnerPtr = this.init(modelPath, runnerConfig.getRunnerConfigPtr());
rwLock.writeLock().unlock(); rwLock.writeLock().unlock();
return modelParallelRunnerPtr != 0L; return modelParallelRunnerPtr != 0L;
@ -85,6 +89,10 @@ public class ModelParallelRunner {
rwLock.writeLock().unlock(); rwLock.writeLock().unlock();
return false; return false;
} }
if (modelParallelRunnerPtr != 0L){
rwLock.writeLock().unlock();
return true;
}
modelParallelRunnerPtr = this.init(modelPath, 0L); modelParallelRunnerPtr = this.init(modelPath, 0L);
rwLock.writeLock().unlock(); rwLock.writeLock().unlock();
return modelParallelRunnerPtr != 0; return modelParallelRunnerPtr != 0;

View File

@ -204,6 +204,10 @@ Status ResourceManager::DistinguishPhysicalAndLogicalByNuma(std::vector<std::vec
} }
void InitWorkerThread::Destroy() { void InitWorkerThread::Destroy() {
if (model_worker_ != nullptr) {
predict_task_queue_->SetPredictTaskDone();
predict_task_queue_ = nullptr;
}
std::unique_lock<std::mutex> l(mtx_init_); std::unique_lock<std::mutex> l(mtx_init_);
is_destroy_ = true; is_destroy_ = true;
is_launch_ = true; is_launch_ = true;