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.

0.6.0-stable
MW 2008-04-16 15:49:28 +00:00
parent 5b62491e9f
commit 54eaadeb82
1 changed files with 1 additions and 0 deletions

View File

@ -1460,6 +1460,7 @@ namespace OpenSim.Region.Communications.OGS1
AsyncCallback ConnectedMethodCallback = new AsyncCallback(ConnectedMethod); AsyncCallback ConnectedMethodCallback = new AsyncCallback(ConnectedMethod);
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IAsyncResult ar = socket.BeginConnect(m_EndPoint, ConnectedMethodCallback, socket); IAsyncResult ar = socket.BeginConnect(m_EndPoint, ConnectedMethodCallback, socket);
System.Threading.Thread.Sleep(500);
ar.AsyncWaitHandle.WaitOne(timeOut*1000, false); ar.AsyncWaitHandle.WaitOne(timeOut*1000, false);
} }