Send a new result to a waiting id_task
| 1824 | |
| 1825 | // Send a new result to a waiting id_task |
| 1826 | void send(server_task_result_ptr && result) { |
| 1827 | SRV_DBG("sending result for task id = %d\n", result->id); |
| 1828 | |
| 1829 | std::unique_lock<std::mutex> lock(mutex_results); |
| 1830 | for (const auto & id_task : waiting_task_ids) { |
| 1831 | if (result->id == id_task) { |
| 1832 | SRV_DBG("task id = %d pushed to result queue\n", result->id); |
| 1833 | |
| 1834 | queue_results.emplace_back(std::move(result)); |
| 1835 | condition_results.notify_all(); |
| 1836 | return; |
| 1837 | } |
| 1838 | } |
| 1839 | } |
| 1840 | |
| 1841 | // terminate the waiting loop |
| 1842 | void terminate() { |
no outgoing calls
no test coverage detected