MCPcopy Create free account
hub / github.com/ceph/ceph / add_thread

Method add_thread

src/msg/async/Stack.cc:37–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35#define dout_prefix *_dout << "stack "
36
37std::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
63std::shared_ptr<NetworkStack> NetworkStack::create(CephContext *c,
64 const std::string &t)

Callers

nothing calls this directly

Calls 8

cpp_strerrorFunction · 0.85
init_doneMethod · 0.80
process_eventsMethod · 0.80
set_ownerMethod · 0.45
initializeMethod · 0.45
tincMethod · 0.45
resetMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected