| 241 | } |
| 242 | |
| 243 | void DeterministicTimer::endThreadedDelay(struct timespec delayTicks) |
| 244 | { |
| 245 | ThreadInfo* thread = ThreadManager::getCurrentThread(); |
| 246 | |
| 247 | if (isInsideFrameBoundary()) { |
| 248 | thread->addedDelay = {0, 0}; |
| 249 | thread->fakeExtraTicks = {0, 0}; |
| 250 | return; |
| 251 | } |
| 252 | |
| 253 | if (framecount > thread->startingFrameDelay) { |
| 254 | /* We ended the delay after a frame boundary, so we don't add the delay to the timer */ |
| 255 | thread->addedDelay = {0, 0}; |
| 256 | thread->fakeExtraTicks = {0, 0}; |
| 257 | return; |
| 258 | } |
| 259 | |
| 260 | thread->addedDelay += delayTicks; |
| 261 | |
| 262 | TimeHolder maxThreadedDelay = {2, 0}; |
| 263 | |
| 264 | if (thread->addedDelay > maxThreadedDelay) { |
| 265 | LOG(LL_WARN, LCF_TIMESET, "We detected some softlocks, we fake advancing time for thread %d by %u.%09u seconds", thread->real_tid, delayTicks.tv_sec, delayTicks.tv_nsec); |
| 266 | thread->fakeExtraTicks += delayTicks; |
| 267 | thread->addedDelay = {0, 0}; |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | void DeterministicTimer::flushDelay() |
| 272 | { |
no outgoing calls
no test coverage detected