MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / reschedule

Method reschedule

src/jrd/jrd.cpp:9312–9340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9310}
9311
9312void 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
9342ULONG thread_db::adjustWait(ULONG wait) const
9343{

Callers 2

JRD_rescheduleFunction · 0.80
CCH_exclusive_attachmentFunction · 0.80

Calls 7

getAttachmentMethod · 0.95
getLockCounterMethod · 0.80
yieldClass · 0.50
sleepFunction · 0.50
getSyncMethod · 0.45
getStableMethod · 0.45
hasContentionMethod · 0.45

Tested by

no test coverage detected