Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 393 Bytes

PH_S008.md

File metadata and controls

9 lines (5 loc) · 393 Bytes

PH_S008 - Timer Scheduled upon Instantiation

Problem

Side-effects inside constructors and especially starting new timers should be avoided in general as it is unexpected behavior. Moreover, if the newly started timer accesses data of the constructed instance it can lead to data races.

Solution

Create a factory method to instantiate the new object and start the respective timer.