Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 399 Bytes

PH_B002.md

File metadata and controls

9 lines (5 loc) · 399 Bytes

PH_B002 - Monitor.Wait inside Nested Locks

Problem

The invocation of Monitor.Wait(...) is enclosed by at least two nested lock statements. Since the wait instruction will only release the lock on the specified object, the lock on the other object is not freed. This constellation may therefore lead to a deadlock.

Solution

Do not make use of Monitor.Wait(...) inside nested locks.