RFR: 8329351: Add runtime/Monitor/TestRecursiveLocking.java for recursive Java monitor stress testing [v3]
Fredrik Bredberg
fbredberg at openjdk.org
Wed Nov 20 18:53:38 UTC 2024
On Wed, 20 Nov 2024 16:11:39 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
>> Fredrik Bredberg has updated the pull request incrementally with one additional commit since the last revision:
>>
>> s/removed/removes/
>
> test/hotspot/jtreg/runtime/Monitor/TestRecursiveLocking.java line 230:
>
>> 228: counter++;
>> 229:
>> 230: // Legacy mode has no lock stack, I.e. there is no limit
>
> nit typography: s/stack, I.e. there/stack, i.e., there/
> - lower case "i.e." followed by a comma
fixed
> test/hotspot/jtreg/runtime/Monitor/TestRecursiveLocking.java line 238:
>
>> 236: }
>> 237:
>> 238: // We havn't reached the stack lock capacity (recursion
>
> nit typo: s/havn't/haven't /
fixed
> test/hotspot/jtreg/runtime/Monitor/TestRecursiveLocking.java line 392:
>
>> 390: }
>> 391:
>> 392: static void usage(int mode, int n_secs) {
>
> Please drop these parameters.
fixed
> test/hotspot/jtreg/runtime/Monitor/TestRecursiveLocking.java line 399:
>
>> 397: System.err.println("where:");
>> 398: System.err.println(" n_secs ::= > 0");
>> 399: System.err.println(" Default n_secs is " + n_secs + ".");
>
> Please change this to:
>
> System.err.println(" Default n_secs is " + def_n_secs + ".");
fixed
> test/hotspot/jtreg/runtime/Monitor/TestRecursiveLocking.java line 402:
>
>> 400: System.err.println(" mode ::= 1 - outer and inner");
>> 401: System.err.println(" ::= 2 - alternate A and B");
>> 402: System.err.println(" Default mode is " + mode + ".");
>
> Please change this to:
>
> System.err.println(" Default mode is " + def_mode + ".");
fixed
> test/hotspot/jtreg/runtime/Monitor/TestRecursiveLocking.java line 408:
>
>> 406: public static void main(String... argv) throws Exception {
>> 407: int mode = 2;
>> 408: int n_secs = 30;
>
> Please change this to:
>
> static final int def_mode = 2;
> static final int def_n_secs = 30;
> int mode = def_mode;
> int n_secs = def_n_secs;
Fixed, but the `static final` ones had to be moved up to get it to compile.
> test/hotspot/jtreg/runtime/Monitor/TestRecursiveLocking.java line 411:
>
>> 409:
>> 410: if (argv.length != 0 && argv.length != 1 && argv.length != 2) {
>> 411: usage(mode, n_secs);
>
> Please drop these parameters.
fixed
> test/hotspot/jtreg/runtime/Monitor/TestRecursiveLocking.java line 424:
>
>> 422: System.err.println("ERROR: '" + argv[0]
>> 423: + "': invalid n_secs value.");
>> 424: usage(mode, n_secs);
>
> Please drop these parameters.
fixed
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22238#discussion_r1850821366
PR Review Comment: https://git.openjdk.org/jdk/pull/22238#discussion_r1850821614
PR Review Comment: https://git.openjdk.org/jdk/pull/22238#discussion_r1850824024
PR Review Comment: https://git.openjdk.org/jdk/pull/22238#discussion_r1850823622
PR Review Comment: https://git.openjdk.org/jdk/pull/22238#discussion_r1850825642
PR Review Comment: https://git.openjdk.org/jdk/pull/22238#discussion_r1850823011
PR Review Comment: https://git.openjdk.org/jdk/pull/22238#discussion_r1850824581
PR Review Comment: https://git.openjdk.org/jdk/pull/22238#discussion_r1850825069
More information about the hotspot-runtime-dev
mailing list