| 9340 | } |
| 9341 | |
| 9342 | ULONG 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 |
no test coverage detected