[jdk19] RFR: 8287847: Fatal Error when suspending virtual thread after it has terminated [v3]

Chris Plummer cjplummer at openjdk.org
Thu Jun 30 15:12:06 UTC 2022


On Thu, 30 Jun 2022 06:34:55 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Actually I was a bit confused as to why thread was declared volatile, so I just followed the pattern. Maybe you can explain since you wrote it.
>
> I'm just pointing out that initialising breakpointReached to false is unnecessary as it's the default value.

but do either of these fields need to be volatile?

>> That came from TestScaffold.startUp():
>> 
>>     protected void startUp(String targetName) {
>>         List argList = new ArrayList(Arrays.asList(args));
>>         argList.add(targetName);
>>         println("run args: " + argList);
>>         connect((String[]) argList.toArray(args));
>>         waitForVMStart();
>>     }
>> 
>> TBH I find myself staring at Streams code like that for way too long before I figure out what it is trying to do. If you use/read code like that a lot, it's probably not an issue, but I don't, and prefer something more straight forward, even if it is not nearly as elegant. Someone should add `String[] Arrays.appendToArray(String[] arr, String s)`, or even `String[] Arrays.concat(String[] s1, String[] s2)` would do.
>
> Whatever you are comfortable with but I think we should fix the raw type and avoid the cast.

fixed

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

PR: https://git.openjdk.org/jdk19/pull/88


More information about the serviceability-dev mailing list