Project

General

Profile

Emulator Issues #7560

Improve Common/Event.h documentation/tests about Reset() and Wait()

Added by delroth over 6 years ago.

Status:
Accepted
Priority:
Normal
Assignee:
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

Reset() is said to be a "bad idea" in the Event class documentation without
explaining why this is the case. The reason why is because Wait() clears
the internal flag already, making the Event re-usable, so Reset() only has
a use between a Set() and a Wait(), which is usually racy.

This needs to be documented better and Wait() needs a unittest that checks that the flag is indeed reset afterwards.

Also available in: Atom PDF