Why to use lock statement in C#?

Technology CommunityCategory: C#Why to use lock statement in C#?
VietMX Staff asked 3 years ago

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.