共用方式為


C# synchronization blocks containing await or how to lock a block with an await

Recently working on a project, I came across a scenario where I needed to lock a block so that only one thread could enter the block at a time. Simple Monitors, I thought. However as soon as I put the...