fix sporadic crash (#9616)

Signed-off-by: fishbell <bell.song@intel.com>
This commit is contained in:
song, bell 2022-01-13 02:25:53 -05:00 committed by GitHub
parent 6d3f99c7db
commit 282f37cdae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -269,6 +269,8 @@ MultiDeviceExecutableNetwork::MultiDeviceExecutableNetwork(const std::string&
auto recycleTask = [this]() mutable {
WaitActualNetworkReady();
while (!_exitFlag && _loadContext[ACTUALDEVICE].isAlready) {
// handle the case of ACTUAL faster than CPU
_loadContext[CPU].future.wait();
// clean up helper infer requests
// first, wait for all the remaining requests to finish
for (auto& iter : _workerRequests["CPU_HELP"]) {