| 35 | #define dout_prefix *_dout << "stack " |
| 36 | |
| 37 | std::function<void ()> NetworkStack::add_thread(Worker* w) |
| 38 | { |
| 39 | return [this, w]() { |
| 40 | rename_thread(w->id); |
| 41 | const unsigned EventMaxWaitUs = 30000000; |
| 42 | w->center.set_owner(); |
| 43 | ldout(cct, 10) << __func__ << " starting" << dendl; |
| 44 | w->initialize(); |
| 45 | w->init_done(); |
| 46 | while (!w->done) { |
| 47 | ldout(cct, 30) << __func__ << " calling event process" << dendl; |
| 48 | |
| 49 | ceph::timespan dur; |
| 50 | int r = w->center.process_events(EventMaxWaitUs, &dur); |
| 51 | if (r < 0) { |
| 52 | ldout(cct, 20) << __func__ << " process events failed: " |
| 53 | << cpp_strerror(errno) << dendl; |
| 54 | // TODO do something? |
| 55 | } |
| 56 | w->perf_logger->tinc(l_msgr_running_total_time, dur); |
| 57 | } |
| 58 | w->reset(); |
| 59 | w->destroy(); |
| 60 | }; |
| 61 | } |
| 62 | |
| 63 | std::shared_ptr<NetworkStack> NetworkStack::create(CephContext *c, |
| 64 | const std::string &t) |
nothing calls this directly
no test coverage detected