Using system; <br/> using system. collections. generic; <br/> using system. LINQ; <br/> using system. text; <br/> using system. threading; </P> <p> namespace multithreading <br/>{< br/> class mutex class <br/>{< br/> Public static void main () <br/>{< br/> // mutex is primarily characterized by inter-process sharing, mutual exclusion, lock, and name. <Br/> bool creatednew; <br/> mutex = new mutex (false, "Aladdin", out creatednew); </P> <p> If (mutex. waitone (1000, false) <br/>{< br/> try <br/>{< br/> console. writeline ("started properly ..... "); <Br/> console. readline (); <br/>}< br/> finally <br/> {<br/> mutex. releasemutex (); <br/>}< br/> else <br/>{< br/> console. writeline ("You have already started one and don't bother again"); <br/> console. read (); <br/>}</P> <p> // Note: To determine whether a mutex thread already exists, you can directly use the creatednew out parameter to determine <br/>}< br/>