| 36 | } |
| 37 | |
| 38 | void OrderExecutor::executionLoop() { |
| 39 | while (running_) { |
| 40 | std::shared_ptr<Order> order; |
| 41 | { |
| 42 | std::unique_lock<std::mutex> lock(mutex_); |
| 43 | cv_.wait(lock, [this] { |
| 44 | return !order_queue_.empty() || !running_; |
| 45 | }); |
| 46 | |
| 47 | if (!running_) break; |
| 48 | |
| 49 | order = order_queue_.front(); |
| 50 | order_queue_.pop(); |
| 51 | } |
| 52 | |
| 53 | executeOrder(order); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | void OrderExecutor::executeOrder(std::shared_ptr<Order> order) { |
| 58 | try { |
nothing calls this directly
no outgoing calls
no test coverage detected