a sample to explain how simple locks in C# works