c# Programming Glossary: lockobj
C# Producer/Consumer pattern http://stackoverflow.com/questions/1371249/c-sharp-producer-consumer-pattern my code class Program static void Main string args Object lockObj new object Queue string queue new Queue string Producer p new.. queue new Queue string Producer p new Producer queue lockObj Consumer c1 new Consumer queue lockObj c1 Consumer c2 new Consumer.. new Producer queue lockObj Consumer c1 new Consumer queue lockObj c1 Consumer c2 new Consumer queue lockObj c2 Thread t1 new Thread..
Re-entrant locks in C# http://stackoverflow.com/questions/391913/re-entrant-locks-in-c-sharp a deadlock using C# on .NET class MyClass private object lockObj new object public void Foo lock lockObj Bar public void Bar.. private object lockObj new object public void Foo lock lockObj Bar public void Bar lock lockObj Do something c# .net.. public void Foo lock lockObj Bar public void Bar lock lockObj Do something c# .net multithreading locking deadlock share..
How to get IP all hosts in LAN http://stackoverflow.com/questions/4042789/how-to-get-ip-all-hosts-in-lan countdown static int upCount 0 static object lockObj new object const bool resolveNames true static void Main string.. 0 is up 1 ms ip e.Reply.RoundtripTime lock lockObj upCount else if e.Reply null Console.WriteLine Pinging..
Does a locked object stay locked if an exception occurs inside it? http://stackoverflow.com/questions/590159/does-a-locked-object-stay-locked-if-an-exception-occurs-inside-it for 2 reasons first lock is essentially Monitor.Enter lockObj try ... finally Monitor.Exit lockObj Second you catch and don't.. Monitor.Enter lockObj try ... finally Monitor.Exit lockObj Second you catch and don't re throw the inner exception so the..
|