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); } } } }