| 9310 | } |
| 9311 | |
| 9312 | void thread_db::reschedule() |
| 9313 | { |
| 9314 | // Somebody has kindly offered to relinquish |
| 9315 | // control so that somebody else may run |
| 9316 | |
| 9317 | checkCancelState(); |
| 9318 | |
| 9319 | StableAttachmentPart::Sync* sync = this->getAttachment()->getStable()->getSync(); |
| 9320 | |
| 9321 | if (sync->hasContention()) |
| 9322 | { |
| 9323 | FB_UINT64 cnt = sync->getLockCounter(); |
| 9324 | |
| 9325 | { // scope |
| 9326 | EngineCheckout cout(this, FB_FUNCTION); |
| 9327 | Thread::yield(); |
| 9328 | |
| 9329 | while (sync->hasContention() && (sync->getLockCounter() == cnt)) |
| 9330 | Thread::sleep(1); |
| 9331 | } |
| 9332 | |
| 9333 | checkCancelState(); |
| 9334 | } |
| 9335 | |
| 9336 | Monitoring::checkState(this); |
| 9337 | |
| 9338 | if (tdbb_quantum <= 0) |
| 9339 | tdbb_quantum = (tdbb_flags & TDBB_sweeper) ? SWEEP_QUANTUM : QUANTUM; |
| 9340 | } |
| 9341 | |
| 9342 | ULONG thread_db::adjustWait(ULONG wait) const |
| 9343 | { |
no test coverage detected