Skip to content

Commit

Permalink
[nfs] fixed synchronization in CNfsConnection::CheckIfIdle()
Browse files Browse the repository at this point in the history
  • Loading branch information
neo1973 committed Jul 2, 2016
1 parent c2239eb commit 205215a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xbmc/filesystem/NFSFile.cpp
Expand Up @@ -351,11 +351,11 @@ void CNfsConnection::Deinit()
/* This is called from CApplication::ProcessSlow() and is used to tell if nfs have been idle for too long */
void CNfsConnection::CheckIfIdle()
{
CSingleLock lock(*this);
/* We check if there are open connections. This is done without a lock to not halt the mainthread. It should be thread safe as
worst case scenario is that m_OpenConnections could read 0 and then changed to 1 if this happens it will enter the if wich will lead to another check, wich is locked. */
if (m_OpenConnections == 0 && m_pNfsContext != NULL)
{ /* I've set the the maxiumum IDLE time to be 1 min and 30 sec. */
CSingleLock lock(*this);
if (m_OpenConnections == 0 /* check again - when locked */)
{
if (m_IdleTimeout > 0)
Expand Down

0 comments on commit 205215a

Please sign in to comment.