On Wed, 19 Jun 2024 14:53:27 GMT, Viktor Klang <vkl...@openjdk.org> wrote:

>> yeah, it's the C++ construction where the constructor and the destructor 
>> have side effects. It increases the system timer resolution, unless 
>> `ForceTimeHighResolution` is set. `ForceTimeHighResolution`, contrary to its 
>> name and help text, forces [low timer 
>> resolution](https://bugs.openjdk.org/browse/JDK-6435126). Sigh.
>
> Oh. That's.... interesting. 😞

Of course pre-existing, but the typical pattern we use with RAII objects that 
may or may not do something is to give it a constructor argument, e.g. `bool 
activate`, that controls if it is activated. Allocating an RAII object with 
new/delete seems odd.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19778#discussion_r1647001238

Reply via email to