RFR: Fix misuse of atomic flag

Zhengyu Gu zgu at openjdk.java.net
Wed Sep 1 23:48:49 UTC 2021


On Wed, 1 Sep 2021 20:56:44 GMT, William Kemper <wkemper at openjdk.org> wrote:

> This change fixes an assert that GC isn't cancelled in the middle of a safepoint. The assert was triggered during the tier2 test: `TestJNIGlobalRefs`. The test uses the _aggressive_ heuristic which runs GC's back to back. The atomic `_preemption_allowed` variable was being misused in a non-atomic way which could lead to the regulator thread cancelling GC after the control thread has gone to the final mark safepoint.

Looks good.

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

Marked as reviewed by zgu (Committer).

PR: https://git.openjdk.java.net/shenandoah/pull/63


More information about the shenandoah-dev mailing list