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

Method adjustWait

src/jrd/jrd.cpp:9342–9356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9340}
9341
9342ULONG thread_db::adjustWait(ULONG wait) const
9343{
9344 if ((wait == 0) || (tdbb_flags & TDBB_wait_cancel_disable) || !tdbb_reqTimer)
9345 return wait;
9346
9347 // This limit corresponds to the lock manager restriction (wait time is signed short)
9348 static const ULONG MAX_WAIT_TIME = MAX_SSHORT; // seconds
9349
9350 const unsigned int timeout = tdbb_reqTimer->timeToExpire(); // milliseconds
9351
9352 const ULONG adjustedTimeout =
9353 (timeout < MAX_WAIT_TIME * 1000) ? (timeout + 999) / 1000 : MAX_WAIT_TIME;
9354
9355 return MIN(wait, adjustedTimeout);
9356}
9357
9358// end thread_db methods
9359

Callers 1

wait_for_requestMethod · 0.80

Calls 1

timeToExpireMethod · 0.80

Tested by

no test coverage detected