Monitor
using System;
using System.Threading;
class MainClass
{
[STAThread]
static void Main(string[] args)
{
object t = new object();
int r = 0;
try
{
if ( Monitor.TryEnter( t, 250 ) )
{
r++;
}
}
finally
{
try
{
Monitor.Exit( t );
}
catch( SynchronizationLockException sle )
{
Console.WriteLine(sle);
}
}
}
}
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
|