RFR: 8322853: Should use ConditionalMutexLocker in NativeHeapTrimmerThread::print_state

David Holmes dholmes at openjdk.org
Wed Jan 3 06:56:48 UTC 2024


On Wed, 3 Jan 2024 06:30:41 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Otherwise all variables used in relation to "condition variables" would have to be declared volatile.

Actually that is a mis-statement as `volatile` is neither necessary nor sufficient to fix any problem that might exist. The compiler simply can't fail to re-load `_stop` in _this_ code else multi-threaded programming would be broken.

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

PR Comment: https://git.openjdk.org/jdk/pull/17226#issuecomment-1874923444


More information about the hotspot-runtime-dev mailing list