fixed: no need to lock if only checking for a closed socket

This commit is contained in:
Bob van Loosen 2013-03-26 22:53:58 +01:00
parent b129dcc2f8
commit b7f56dfe4d

View file

@ -246,9 +246,9 @@ void CBitVis::Run()
while ((msg = m_jackclient.GetMessage()) != MsgNone)
LogDebug("got message %s from jack client", MsgToString(msg));
CLock lock(m_condition);
if (!m_socket.IsOpen() && m_address && GetTimeUs() - lastconnect > CONNECTINTERVAL)
{
CLock lock(m_condition);
if (m_socket.Open(m_address, m_port, 10000000) != SUCCESS)
{
LogError("Failed to connect: %s", m_socket.GetError().c_str());
@ -260,7 +260,6 @@ void CBitVis::Run()
}
didconnect = true;
}
lock.Leave();
if (didconnect)
lastconnect = GetTimeUs();