I am debugging a WebProject in VS2010 that runs on a local dev server (cassini?). One of the aspx pages calls the ManualResetEvent.WaitOne () page, and the other aspx page calls the ManualResetEvent.Set () (in the same global object) to free the first page.
When I look at the thread list in VS2010, there seem to be a lot of worker threads. However, the web server seems to stop processing something, blocked by a call to ManualResetEvent.WaitOne (). Therefore, ManualResetEvent.Set () is not loaded if .WaitOne () time is missing.
What's going on here?
// Sample Code Class SyncTest { private System.Threading.ManualResetEvent eConnected = new System.Threading.ManualResetEvent(false); private bool isConnected; public SyncTest () { this.isConnected = false; } public void SetConnected(bool state) { isConnected = state; if (state) eConnected.Set(); else eConnected.Reset(); } public bool WaitForConnection(int timeout) { return eConnected.WaitOne(timeout); } }
source share