private object _lock = new object(); public void A() { lock(_lock) { // do something critical B(); } } public void B() { // do something else }
A
Task
Thread
B
lock
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)