RFR: 8318528: Rename TestUnstructuredLocking test
David Holmes
dholmes at openjdk.org
Fri Oct 20 02:48:33 UTC 2023
On Thu, 19 Oct 2023 16:55:52 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> Low-priority house-keeping. See the rationale in the bug.
>
> Additional testing:
> - [x] macos-aarch64-server-fastdebug, affected test passes
"unbalanced" is not right here either IMO but it depends on how you define it. To me balanced locking is the same as structured locking as defined by JVMS: number of locks == number of unlocks by the end of the method (they are balanced), and you have to have a lock preceding each unlock.
I would have used unstructured locking to describe this test case because it does not follow the block-structure imposed by the Java language - hence is unstructured.
The locking pattern of `lock(A)->lock(B)->unlock(A)->unlock(B)` is known as chained-locking, or hand-over-hand locking in the literature.
I guess the test could be called `TestOutOfOrderUnlocking` as that is what is actually tests.
-------------
Changes requested by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/16273#pullrequestreview-1689094284
More information about the hotspot-runtime-dev
mailing list