Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 416 Bytes

PH_B003.md

File metadata and controls

9 lines (5 loc) · 416 Bytes

PH_B003 - Unsynchronized Collection Access

Problem

On access to the collection occurs inside a lock statement while another does not. This constellation can lead to data races and race conditions when both accesses run concurrently. Moreover, even if the non-synchronized access is read-only, the problem persists.

Solution

Enclose all collection accesses -even the read-only- with a lock statement.