| 124 | } |
| 125 | |
| 126 | SerialExecutor::~SerialExecutor() { |
| 127 | #ifndef ARROW_ENABLE_THREADING |
| 128 | GetSerialExecutorGlobalState()->all_executors.erase(this); |
| 129 | #endif |
| 130 | auto state = state_; |
| 131 | std::unique_lock<std::mutex> lk(state->mutex); |
| 132 | if (!state->task_queue.empty()) { |
| 133 | // We may have remaining tasks if the executor is being abandoned. We could have |
| 134 | // resource leakage in this case. However, we can force the cleanup to happen now |
| 135 | state->paused = false; |
| 136 | lk.unlock(); |
| 137 | RunLoop(); |
| 138 | lk.lock(); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | int SerialExecutor::GetNumTasks() { |
| 143 | auto state = state_; |
nothing calls this directly
no test coverage detected