Mono.Unix.TestScript.__Main C# (CSharp) Method

__Main() static private method

static private __Main ( string args ) : void
args string
return void
        static void __Main(string[] args)
        {
            string file = @"/home/user/Desktop/krok/lock2";

            FileMutex mutex = new FileMutex(file);
            Console.WriteLine("Trying to obtain exclusive lock...");

            mutex.Wait(1000 * 5);
            Console.WriteLine("exclusive lock is obtained...");

            Console.WriteLine("Press 'Enter' to release lock.");
            Console.ReadLine();

            mutex.Release();
            Console.WriteLine("Lock is released.");

            Console.ReadLine();
            Console.WriteLine("Press 'Enter' to exit.");
        }
    }
TestScript