MCPcopy Create free account
hub / github.com/apple/foundationdb / setNetworkThread

Method setNetworkThread

flow/Trace.cpp:1286–1300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1284thread_local bool BaseTraceEvent::networkThread = false;
1285
1286void BaseTraceEvent::setNetworkThread() {
1287 if (!networkThread) {
1288 if (FLOW_KNOBS->ALLOCATION_TRACING_ENABLED) {
1289 // Ensure that threadId is initialized before we enable allocation tracing, otherwise it would
1290 // be initialized either by first normal usage of TraceEvent or by allocation tracing which is
1291 // non-deterministic, and we could run into https://github.com/apple/foundationdb/issues/7872.
1292 getTraceThreadId();
1293 --g_allocation_tracing_disabled;
1294 }
1295
1296 traceEventThrottlerCache = new TransientThresholdMetricSample<Standalone<StringRef>>(
1297 FLOW_KNOBS->TRACE_EVENT_METRIC_UNITS_PER_SAMPLE, FLOW_KNOBS->TRACE_EVENT_THROTTLER_MSG_LIMIT);
1298 networkThread = true;
1299 }
1300}
1301
1302bool BaseTraceEvent::isNetworkThread() {
1303 return networkThread;

Callers

nothing calls this directly

Calls 1

getTraceThreadIdFunction · 0.85

Tested by

no test coverage detected