| 798 | } |
| 799 | |
| 800 | void AsyncMessenger::wait() |
| 801 | { |
| 802 | { |
| 803 | std::unique_lock locker{lock}; |
| 804 | if (!started) { |
| 805 | return; |
| 806 | } |
| 807 | while (!stopped) |
| 808 | stop_cond.wait(locker); |
| 809 | } |
| 810 | dispatch_queue.shutdown(); |
| 811 | if (dispatch_queue.is_started()) { |
| 812 | ldout(cct, 10) << __func__ << ": waiting for dispatch queue" << dendl; |
| 813 | dispatch_queue.wait(); |
| 814 | dispatch_queue.discard_local(); |
| 815 | ldout(cct, 10) << __func__ << ": dispatch queue is stopped" << dendl; |
| 816 | } |
| 817 | |
| 818 | // close all connections |
| 819 | shutdown_connections(false); |
| 820 | stack->drain(); |
| 821 | |
| 822 | ldout(cct, 10) << __func__ << ": done." << dendl; |
| 823 | ldout(cct, 1) << __func__ << " complete." << dendl; |
| 824 | started = false; |
| 825 | } |
| 826 | |
| 827 | void AsyncMessenger::add_accept(Worker *w, ConnectedSocket cli_socket, |
| 828 | const entity_addr_t &listen_addr, |
nothing calls this directly
no test coverage detected