From 54eaadeb8276f77c597044f2eb537db05fbbdb84 Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 16 Apr 2008 15:49:28 +0000 Subject: added a thread.Sleep(500) to OGS1GridServices.CheckRegion() , to try to help avoid a potential race condition. As IAsyncResult.AsyncWaitHandle.WaitOne before a AsyncCallback is called. So in this case, its a race to see who sets or reads the bool m_bAvailable first. --- OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 8c40d3e..43bba8b 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -1460,6 +1460,7 @@ namespace OpenSim.Region.Communications.OGS1 AsyncCallback ConnectedMethodCallback = new AsyncCallback(ConnectedMethod); Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); IAsyncResult ar = socket.BeginConnect(m_EndPoint, ConnectedMethodCallback, socket); + System.Threading.Thread.Sleep(500); ar.AsyncWaitHandle.WaitOne(timeOut*1000, false); } -- cgit v1.1