Skip to content

Latest commit

 

History

History
10 lines (6 loc) · 465 Bytes

PH_S016.md

File metadata and controls

10 lines (6 loc) · 465 Bytes

PH_S016 - Monitor.Pulse with multiple Monitor.Wait

Problem

Multiple Monitor.Wait invocations access the same synchronization object. Therefore, the chance for multiple semantically different wait conditions is high. If multiple threads are awaiting different states (i.e., semantically different wait conditions), chances are high that Monitor.Pulse signals the wrong thread.

Solution

Replace the Monitor.Pulse invocation with Monitor.PulseAll.