guard exception in classification_sample_async (#13530)

This commit is contained in:
Zlobin Vladimir authored and GitHub committed 2022-10-20 12:23:34 +03:00
1 parent bea82ec92b
commit 0d4b331f84
1 file changed
+1 -1
@@ -169,13 +169,13 @@ int main(int argc, char* argv[]) {
std::exception_ptr exception_var;
// -------- Step 10. Do asynchronous inference --------
infer_request.set_callback([&](std::exception_ptr ex) {
std::lock_guard<std::mutex> l(mutex);
if (ex) {
exception_var = ex;
condVar.notify_all();
return;
}
std::lock_guard<std::mutex> l(mutex);
cur_iteration++;
slog::info << "Completed " << cur_iteration << " async request execution" << slog::endl;
if (cur_iteration < num_iterations) {