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

Method free_thread

src/iocore/net/UnixNetVConnection.cc:1284–1323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1282}
1283
1284void
1285UnixNetVConnection::free_thread(EThread *t)
1286{
1287 Dbg(dbg_ctl_iocore_net, "Entering UnixNetVConnection::free()");
1288
1289 ink_release_assert(t == this_ethread());
1290
1291 // close socket fd
1292 if (con.sock.is_ok()) {
1293 release_inbound_connection_tracking();
1294 Metrics::Gauge::decrement(net_rsb.connections_currently_open);
1295 }
1296 con.close();
1297
1298 if (is_tunnel_endpoint()) {
1299 Dbg(dbg_ctl_iocore_net, "Freeing UnixNetVConnection that is tunnel endpoint");
1300
1301 Metrics::Gauge::decrement(([&]() -> Metrics::Gauge::AtomicType * {
1302 switch (get_context()) {
1303 case NET_VCONNECTION_IN:
1304 return net_rsb.tunnel_current_client_connections_blind_tcp;
1305 case NET_VCONNECTION_OUT:
1306 return net_rsb.tunnel_current_server_connections_blind_tcp;
1307 default:
1308 ink_release_assert(false);
1309 }
1310 })());
1311 }
1312
1313 clear();
1314 SET_CONTINUATION_HANDLER(this, &UnixNetVConnection::startEvent);
1315 ink_assert(!con.sock.is_ok());
1316 ink_assert(t == this_ethread());
1317
1318 if (from_accept_thread) {
1319 netVCAllocator.free(this);
1320 } else {
1321 THREAD_FREE(this, netVCAllocator, t);
1322 }
1323}
1324
1325void
1326UnixNetVConnection::apply_options()

Callers 3

do_io_closeMethod · 0.95
acceptEventMethod · 0.95
connectUpMethod · 0.95

Calls 5

this_ethreadFunction · 0.85
clearFunction · 0.50
is_okMethod · 0.45
closeMethod · 0.45
freeMethod · 0.45

Tested by

no test coverage detected