8375001: NativeThreadSet get wrong currentNativeThread when using virtual thread#2542
8375001: NativeThreadSet get wrong currentNativeThread when using virtual thread#2542jia-wei-tang wants to merge 1 commit intoopenjdk:masterfrom
Conversation
|
👋 Welcome back jwtang! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
This should probably fixed with a backport of https://bugs.openjdk.org/browse/JDK-8321594 instead. |
|
@jia-wei-tang This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
Hi, I create an issue in the bug system: https://bugs.openjdk.org/browse/JDK-8375001
NativeThread.currentNativeThread();should be replaced byNativeThread.current();. Otherwise, when using virtual thread, the program will run into a wrong state.Now, I just changed the function used in NativeTheadSet.java, but I did not delete the
currentNativeThreadinsrc/java.base/unix/classes/sun/nio/ch/NativeThread.javaandsrc/java.base/windows/classes/sun/nio/ch/NativeThread.java. I am wondering if I should delete these functions since they are useless now. I hope to get some advice. Thank you!Besides, the jtreg testcases which can produce this issue is from JDK-8310902 (with option:
-testThreadFactory:Virtual -testThreadFactoryPath:./jtregTestThreadFactory.jar). Do I need to bring the testcasetest/jdk/java/nio/channels/FileChannel/CloseDuringTransfer.javahere?Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/2542/head:pull/2542$ git checkout pull/2542Update a local copy of the PR:
$ git checkout pull/2542$ git pull https://git.openjdk.org/jdk21u-dev.git pull/2542/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 2542View PR using the GUI difftool:
$ git pr show -t 2542Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/2542.diff
Using Webrev
Link to Webrev Comment