MCPcopy Create free account
hub / github.com/bytedance/bolt / enterArbitration

Method enterArbitration

bolt/exec/MemoryReclaimer.cpp:45–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45void MemoryReclaimer::enterArbitration() {
46 DriverThreadContext* driverThreadCtx = driverThreadContext();
47 if (FOLLY_UNLIKELY(driverThreadCtx == nullptr)) {
48 // Skips the driver suspension handling if this memory arbitration
49 // request is not issued from a driver thread.
50 return;
51 }
52
53 Driver* const driver = driverThreadCtx->driverCtx()->driver;
54 if (driver->task()->enterSuspended(driver->state()) != StopReason::kNone) {
55 // There is no need for arbitration if the associated task has already
56 // terminated.
57 BOLT_FAIL("Terminate detected when entering suspension");
58 }
59}
60
61void MemoryReclaimer::leaveArbitration() noexcept {
62 DriverThreadContext* driverThreadCtx = driverThreadContext();

Callers

nothing calls this directly

Calls 5

driverThreadContextFunction · 0.85
enterSuspendedMethod · 0.80
taskMethod · 0.80
driverCtxMethod · 0.45
stateMethod · 0.45

Tested by

no test coverage detected