* 向队列中写入信息 * @param task */
| 28 | * @param task |
| 29 | */ |
| 30 | CVoid push(UTask&& task) { |
| 31 | while (true) { |
| 32 | if (mutex_.try_lock()) { |
| 33 | deque_.emplace_front(std::move(task)); |
| 34 | mutex_.unlock(); |
| 35 | break; |
| 36 | } else { |
| 37 | std::this_thread::yield(); |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | |
| 43 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected