minor locking issue

LSLKeyTest
UbitUmarov 2016-08-22 07:14:33 +01:00
parent b98b535a6b
commit cc322861ca
1 changed files with 3 additions and 13 deletions

View File

@ -270,7 +270,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
public void Close() public void Close()
{ {
m_log.InfoFormat("[IRC-Connector-{0}] Closing", idn); m_log.InfoFormat("[IRC-Connector-{0}] Closing", idn);
lock (msyncConnect) lock (msyncConnect)
@ -295,7 +294,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
} }
catch (Exception) { } catch (Exception) { }
m_connected = false; m_connected = false;
try { m_writer.Close(); } try { m_writer.Close(); }
@ -308,10 +306,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
catch (Exception) { } catch (Exception) { }
} }
lock (m_connectors) lock (m_connectors)
m_connectors.Remove(this); m_connectors.Remove(this);
} }
} }
@ -327,25 +323,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
public void Connect() public void Connect()
{ {
if (!m_enabled) if (!m_enabled)
return; return;
// Delay until next WD cycle if this is too close to the last start attempt // Delay until next WD cycle if this is too close to the last start attempt
if(_icc_ < ICCD_PERIOD)
while (_icc_ < ICCD_PERIOD)
return; return;
m_log.DebugFormat("[IRC-Connector-{0}]: Connection request for {1} on {2}:{3}", idn, m_nick, m_server, m_ircChannel); m_log.DebugFormat("[IRC-Connector-{0}]: Connection request for {1} on {2}:{3}", idn, m_nick, m_server, m_ircChannel);
_icc_ = 0;
lock (msyncConnect) lock (msyncConnect)
{ {
_icc_ = 0;
try try
{ {
if (m_connected) return; if (m_connected) return;
m_connected = true; m_connected = true;
@ -379,11 +371,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
// expires. By leaving them as they are, the connection will be retried // expires. By leaving them as they are, the connection will be retried
// when the login timeout expires. Which is preferred. // when the login timeout expires. Which is preferred.
} }
} }
return; return;
} }
// Reconnect is used to force a re-cycle of the IRC connection. Should generally // Reconnect is used to force a re-cycle of the IRC connection. Should generally