C#: Dynamic Locking

The other day I stumbled upon what I thought was an interesting problem, with an accompanying illustrative solution. The problem at hand is related to concurrency, »