[MonoDevelop] Monitor.Wait return false immediately on Mono Runtime

mono mono at webkai.net
Sat Sep 17 22:49:51 EDT 2011


Hello

I am using Monodevelop2.6 on Windows Vista.

I build a following code by .NET Runtime. 
Then, 'True' is displayed in 3 second later.

Next, I build by mono2.10.5 runtime.
And I execute it. But 'False' is displayed in console immediately.

Please, Advice.


using System;
using System.Threading;

namespace MonoThreadTest
{
 class MainClass
 {
  static object lockObj = new object();
  
  public static void Main (string[] args)
  {
   new Thread(new ThreadStart(Async)).Start();
   
   Thread.Sleep(3 * 1000);
   
   lock(lockObj)
   {
    Monitor.PulseAll(lockObj);
   }
   
   Console.Read();
  }
  
  static void Async()
  {
   lock(lockObj)
   {
    Console.WriteLine(Monitor.Wait(lockObj, 10 * 1000));
   }
  }
 }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodevelop-list/attachments/20110918/908886b0/attachment.html 


More information about the Monodevelop-list mailing list