| 2966 | } |
| 2967 | |
| 2968 | int32_t Task::yieldIfDue(uint64_t startTimeMicros) { |
| 2969 | if (onThreadSince_ < startTimeMicros) { |
| 2970 | std::lock_guard<std::timed_mutex> l(mutex_); |
| 2971 | // Reread inside the mutex |
| 2972 | if (onThreadSince_ < startTimeMicros && numThreads_ && !toYield_ && |
| 2973 | !terminateRequested_ && !pauseRequested_) { |
| 2974 | toYield_ = numThreads_; |
| 2975 | return numThreads_; |
| 2976 | } |
| 2977 | } |
| 2978 | return 0; |
| 2979 | } |
| 2980 | |
| 2981 | std::vector<ContinuePromise> Task::allThreadsFinishedLocked() { |
| 2982 | std::vector<ContinuePromise> threadFinishPromises; |