File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1642,10 +1642,6 @@ struct server_response {
16421642 server_task_result_ptr recv_with_timeout (const std::unordered_set<int > & id_tasks, int timeout) {
16431643 while (true ) {
16441644 std::unique_lock<std::mutex> lock (mutex_results);
1645- std::cv_status cr_res = condition_results.wait_for (lock, std::chrono::seconds (timeout));
1646- if (cr_res == std::cv_status::timeout) {
1647- return nullptr ;
1648- }
16491645
16501646 for (int i = 0 ; i < (int ) queue_results.size (); i++) {
16511647 if (id_tasks.find (queue_results[i]->id ) != id_tasks.end ()) {
@@ -1654,6 +1650,11 @@ struct server_response {
16541650 return res;
16551651 }
16561652 }
1653+
1654+ std::cv_status cr_res = condition_results.wait_for (lock, std::chrono::seconds (timeout));
1655+ if (cr_res == std::cv_status::timeout) {
1656+ return nullptr ;
1657+ }
16571658 }
16581659
16591660 // should never reach here
You can’t perform that action at this time.
0 commit comments