MCPcopy Create free account
hub / github.com/apache/trafficserver / adjust_thread

Method adjust_thread

include/proxy/ProxyTransaction.h:303–316  ·  view source on GitHub ↗

See if we need to schedule on the primary thread for the transaction or change the thread that is associated with the VC. If we reschedule, the scheduled action is returned. Otherwise, NULL is returned

Source from the content-addressed store, hash-verified

301// See if we need to schedule on the primary thread for the transaction or change the thread that is associated with the VC.
302// If we reschedule, the scheduled action is returned. Otherwise, NULL is returned
303inline Action *
304ProxyTransaction::adjust_thread(Continuation *cont, int event, void *data)
305{
306 NetVConnection *vc = this->get_netvc();
307 EThread *this_thread = this_ethread();
308 if (vc && vc->thread != this_thread) {
309 if (vc->thread->is_event_type(ET_NET)) {
310 return vc->thread->schedule_imm(cont, event, data);
311 } else { // Not a net thread, take over this thread
312 vc->thread = this_thread;
313 }
314 }
315 return nullptr;
316}
317
318inline IOBufferReader *
319ProxyTransaction::get_remote_reader()

Callers 1

Calls 4

get_netvcMethod · 0.95
this_ethreadFunction · 0.85
is_event_typeMethod · 0.80
schedule_immMethod · 0.45

Tested by

no test coverage detected