Explanation Need to lock statement. The lock keyword marks a statement block as a critical section by obtaining the mutual-exclusion lock for a given object, executing a statement, and then releasing the lock. Reference: lock Statement (C# Reference) https://msdn.microsoft.com/en-us/library/c5kehkcz.aspx