in C Sharp by
Why to use lock statement in C#?

1 Answer

0 votes
Lock will make sure one thread will not intercept the other thread which is running the part of code. So lock statement will make the thread wait, block till the object is being released.