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

Method acceptEvent

src/iocore/net/UnixNetVConnection.cc:1009–1048  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1007}
1008
1009int
1010UnixNetVConnection::acceptEvent(int /* event ATS_UNUSED */, Event *e)
1011{
1012 EThread *t = (e == nullptr) ? this_ethread() : e->ethread;
1013 NetHandler *h = get_NetHandler(t);
1014
1015 thread = t;
1016
1017 // Send this NetVC to NetHandler and start to polling read & write event.
1018 if (h->startIO(this) < 0) {
1019 this->free_thread(t);
1020 return EVENT_DONE;
1021 }
1022
1023 // Switch vc->mutex from NetHandler->mutex to new mutex
1024 mutex = new_ProxyMutex();
1025 SCOPED_MUTEX_LOCK(lock2, mutex, t);
1026
1027 // Setup a timeout callback handler.
1028 SET_HANDLER(&UnixNetVConnection::mainEvent);
1029
1030 // Send this netvc to InactivityCop.
1031 nh->startCop(this);
1032
1033 set_inactivity_timeout(inactivity_timeout_in);
1034
1035 if (active_timeout_in) {
1036 UnixNetVConnection::set_active_timeout(active_timeout_in);
1037 }
1038 if (action_.continuation->mutex != nullptr) {
1039 MUTEX_TRY_LOCK(lock3, action_.continuation->mutex, t);
1040 if (!lock3.is_locked()) {
1041 ink_release_assert(0);
1042 }
1043 action_.continuation->handleEvent(NET_EVENT_ACCEPT, this);
1044 } else {
1045 action_.continuation->handleEvent(NET_EVENT_ACCEPT, this);
1046 }
1047 return EVENT_DONE;
1048}
1049
1050//
1051// The main event for UnixNetVConnections.

Callers

nothing calls this directly

Calls 7

free_threadMethod · 0.95
this_ethreadFunction · 0.85
get_NetHandlerFunction · 0.85
new_ProxyMutexFunction · 0.85
startIOMethod · 0.80
startCopMethod · 0.80
handleEventMethod · 0.45

Tested by

no test coverage detected