Integrated: 8301229: Clean up SuspendibleThreadSet::_suspend_all
Erik Österlund
eosterlund at openjdk.org
Mon Jan 30 10:31:30 UTC 2023
On Fri, 27 Jan 2023 14:21:21 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:
> The SuspendibleThreadSet::_suspend_all variable is read and set concurrently, yet relies only on volatiles in accessors. They should use Atomic instead. Also, the _suspend_all getter is called suspend_all(), but since this function doesn't suspend anything, the name looks really confusing where it is, and there is an alias should_yield() that just calls suspend_all(), and better explains what the code does. This CR aims to remove suspend_all() and have a single getter, being should_yield (which reads better everywhere it is used), and make sure the accessors do use Atomic.
This pull request has now been integrated.
Changeset: 7fae3a1d
Author: Erik Österlund <eosterlund at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/7fae3a1d8d39fe0ecef4a1887c4a6053b5d21ca1
Stats: 26 lines in 2 files changed: 7 ins; 3 del; 16 mod
8301229: Clean up SuspendibleThreadSet::_suspend_all
Reviewed-by: stefank, kbarrett, tschatzl
-------------
PR: https://git.openjdk.org/jdk/pull/12256
More information about the hotspot-gc-dev
mailing list