| 189 | }; |
| 190 | |
| 191 | void NetworkStack::drain() |
| 192 | { |
| 193 | ldout(cct, 30) << __func__ << " started." << dendl; |
| 194 | pthread_t cur = pthread_self(); |
| 195 | pool_spin.lock(); |
| 196 | C_drain drain(get_num_worker()); |
| 197 | for (Worker* worker : workers) { |
| 198 | ceph_assert(cur != worker->center.get_owner()); |
| 199 | worker->center.dispatch_event_external(EventCallbackRef(&drain)); |
| 200 | } |
| 201 | pool_spin.unlock(); |
| 202 | drain.wait(); |
| 203 | ldout(cct, 30) << __func__ << " end." << dendl; |
| 204 | } |