| 278 | } |
| 279 | |
| 280 | void RuntimeState::AddCancellationCV(mutex* mutex, ConditionVariable* cv) { |
| 281 | lock_guard<SpinLock> l(cancellation_cvs_lock_); |
| 282 | for (pair<std::mutex*, ConditionVariable*>& entry : cancellation_cvs_) { |
| 283 | // Don't add if already present. |
| 284 | if (mutex == entry.first && cv == entry.second) return; |
| 285 | } |
| 286 | cancellation_cvs_.push_back(make_pair(mutex, cv)); |
| 287 | } |
| 288 | |
| 289 | void RuntimeState::AddBarrierToCancel(CyclicBarrier* cb) { |
| 290 | lock_guard<SpinLock> l(cancellation_cvs_lock_); |
no test coverage detected