forked from premiere/premiere-libtorrent
wakes up the disk io thread once a second to flush caches
This commit is contained in:
parent
f5f9796ba7
commit
af10b55254
|
@ -1016,7 +1016,13 @@ namespace libtorrent
|
|||
mutex_t::scoped_lock jl(m_queue_mutex);
|
||||
|
||||
while (m_jobs.empty() && !m_abort)
|
||||
m_signal.wait(jl);
|
||||
{
|
||||
// if there hasn't been an event in one second
|
||||
// see if we should flush the cache
|
||||
if (!m_signal.timed_wait(jl, boost::get_system_time() + boost::posix_time::seconds(1)))
|
||||
flush_expired_pieces();
|
||||
}
|
||||
|
||||
if (m_abort && m_jobs.empty())
|
||||
{
|
||||
jl.unlock();
|
||||
|
|
Loading…
Reference in New Issue