| 43 | } |
| 44 | |
| 45 | void 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 | |
| 61 | void MemoryReclaimer::leaveArbitration() noexcept { |
| 62 | DriverThreadContext* driverThreadCtx = driverThreadContext(); |
nothing calls this directly
no test coverage detected