Monitor : Monitor : Thread C# Examples


C# Examples » Thread » Monitor »

 

Monitor









    
using  System;
using  System.Threading;

class  MainClass  
{
    [STAThread]
    static  void  Main(string[]  args)
    {
            int  r  =  0;
        object  t  =  new  object();
        
        try
        {
            Monitor.Enter(  t  );
            r++;
        }
        finally
        {
            Monitor.Exit(  t  );
        }
            
    }
}
    
   
  
   



Output

in monotor
in monotor


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Thread
» Monitor