| 1484 | } |
| 1485 | |
| 1486 | void ConnectionsPool::IdleTimer::start() |
| 1487 | { |
| 1488 | FbLocalStatus s; |
| 1489 | ITimerControl* timerCtrl = Firebird::TimerInterfacePtr(); |
| 1490 | |
| 1491 | const time_t expTime = m_connPool.getIdleExpireTime(); |
| 1492 | if (expTime == 0) |
| 1493 | return; |
| 1494 | |
| 1495 | MutexLockGuard guard(m_mutex, FB_FUNCTION); |
| 1496 | |
| 1497 | if (m_time && m_time <= expTime) |
| 1498 | return; |
| 1499 | |
| 1500 | if (m_time) |
| 1501 | timerCtrl->stop(&s, this); |
| 1502 | |
| 1503 | time_t t; |
| 1504 | time(&t); |
| 1505 | time_t delta = expTime - t; |
| 1506 | |
| 1507 | if (delta <= 0) |
| 1508 | delta = 1; |
| 1509 | |
| 1510 | m_time = expTime; |
| 1511 | timerCtrl->start(&s, this, delta * 1000 * 1000); |
| 1512 | } |
| 1513 | |
| 1514 | void ConnectionsPool::IdleTimer::stop() |
| 1515 | { |
no test coverage detected