I am reviewing some codes and found that it uses EnterCriticalSection(&mutex); and LeaveCriticalSection(&mutex);
Basically I just want to know the use of that codes. I already checked MSDN(http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx) and it doesn't give much information on why you should use it. I guess its for locking or something if you have multiple threads but I am not sure. Can you please give me some scenarios where I should use this.