| 968 | } |
| 969 | |
| 970 | void Driver::close() { |
| 971 | if (closed_) { |
| 972 | // Already closed. |
| 973 | return; |
| 974 | } |
| 975 | if (!isOnThread() && !isTerminated()) { |
| 976 | LOG(FATAL) << "Driver::close is only allowed from the Driver's thread"; |
| 977 | } |
| 978 | closeOperators(); |
| 979 | closed_ = true; |
| 980 | Task::removeDriver(ctx_->task, this); |
| 981 | } |
| 982 | |
| 983 | void Driver::closeByTask() { |
| 984 | BOLT_CHECK(isOnThread()); |