CSharp Locking and Inter Thread Communication
Revision as of 12:36, 10 March 2014 by PeterHarding (talk | contribs) (Created page with "=Links= * http://www.albahari.com/threading/part4.aspx * http://stackoverflow.com/questions/15164408/lock-free-concurrent-queue * http://stackoverflow.com/questions/505515/c...")
Links
- http://stackoverflow.com/questions/15164408/lock-free-concurrent-queue
- http://stackoverflow.com/questions/505515/c-sharp-thread-safety-with-get-set
- http://stackoverflow.com/questions/251391/why-is-lockthis-bad
- http://www.codeproject.com/Articles/8018/Bounded-Blocking-Queue-One-Lock
- http://stackoverflow.com/questions/6029804/how-does-lock-work-exactly
bool lockWasTaken = false; var temp = obj; try { Monitor.Enter(temp, ref lockWasTaken); // body } finally { if (lockWasTaken) { Monitor.Exit(temp); } }