Skip to content

Commit

Permalink
Fix deadlock in server manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwiboo committed Nov 10, 2015
1 parent 8967c7c commit 7563ca9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plex/Client/PlexServerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void CPlexServerReachabilityThread::Process()
}

///////////////////////////////////////////////////////////////////////////////////////////////////
CPlexServerManager::CPlexServerManager() : m_stopped(false)
CPlexServerManager::CPlexServerManager() : m_stopped(false), m_reachabilityTestEvent(true)
{
CPlexConnectionPtr conn;

Expand Down Expand Up @@ -286,11 +286,15 @@ void CPlexServerManager::UpdateReachability(bool force)
p.second->m_server->CancelReachabilityTests();
}

lk.unlock();

if (!m_reachabilityTestEvent.WaitMSec(10 * 1000))
{
CLog::Log(LOGWARNING, "CPlexServerManager::UpdateReachability waited 10 seconds for the reachability stuff to finish, will just move on.");
return;
}

lk.lock();
}

if (m_reachabilityThreads.size() > 0)
Expand Down

0 comments on commit 7563ca9

Please sign in to comment.