concept race condition in category asp.net

This is an excerpt from Manning's book ASP.NET 4.0 in Practice.
Typically, Cache is accessed in a multithreading environment, which means that you’re subject to deadlocks and race conditions. When this happens, it’s possible that a call to an instruction is performed at the same time from different threads, and then an unwanted situation occurs.
Depending on your code, you might execute the code multiple times or not at all. To keep that from happening, you need to write code that will use locking and avoid concurrency. Of course, you only need to do this when items are being added to the cache, because reading is thread-safe by design. In reality, MemoryCache is thread-safe, but because race conditions can occur while reading, a lock is required to ensure data integrity. The following listing contains the implementation of the solution.