File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ void ov::IAsyncInferRequest::cancel() {
99
99
100
100
void ov::IAsyncInferRequest::set_callback (std::function<void (std::exception_ptr)> callback) {
101
101
check_state ();
102
+ std::lock_guard<std::mutex> lock{m_mutex};
102
103
m_callback = std::move (callback);
103
104
}
104
105
@@ -148,11 +149,12 @@ ov::threading::Task ov::IAsyncInferRequest::make_next_stage_task(
148
149
149
150
if ((itEndStage == itNextStage) || (nullptr != currentException)) {
150
151
auto lastStageTask = [this , currentException]() mutable {
151
- auto promise = std::move (m_promise) ;
152
+ std::promise< void > promise ;
152
153
std::function<void (std::exception_ptr)> callback;
153
154
{
154
155
std::lock_guard<std::mutex> lock{m_mutex};
155
156
m_state = InferState::IDLE;
157
+ promise = std::move (m_promise);
156
158
std::swap (callback, m_callback);
157
159
}
158
160
if (callback) {
You can’t perform that action at this time.
0 commit comments