flush expired sessions from cache
| 1842 | |
| 1843 | // flush expired sessions from cache |
| 1844 | void Sessions::Flush() |
| 1845 | { |
| 1846 | Lock guard(mutex_); |
| 1847 | sess_iterator next = list_.begin(); |
| 1848 | uint current = lowResTimer(); |
| 1849 | |
| 1850 | while (next != list_.end()) { |
| 1851 | sess_iterator si = next; |
| 1852 | ++next; |
| 1853 | if ( ((*si)->GetBornOn() + (*si)->GetTimeOut()) < current) { |
| 1854 | del_ptr_zero()(*si); |
| 1855 | list_.erase(si); |
| 1856 | } |
| 1857 | } |
| 1858 | count_ = 0; // reset flush counter |
| 1859 | } |
| 1860 | |
| 1861 | |
| 1862 | // remove a self thread error |
no test coverage detected