-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8370568: Refer to Thread.interrupted as "interrupted status" consistently #27972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👋 Welcome back prappo! A progress list of the required criteria for merging this PR into |
|
@pavelrappo This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
|
@pavelrappo The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
RogerRiggs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java
Outdated
Show resolved
Hide resolved
AlanBateman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I skimmed through the replace and it looks okay. There are several places where we should be linking as "interrupted status" will look like a grammatical error with the change. We do that as needed, not this PR.
This is the first update to some of these files in 2025 so you will need to update the copyright header of those files.
Note: any commit hashes below might be outdated due to subsequent history rewriting (e.g. git rebase). + update make/langtools/tools/javacserver/server/CompilerThreadPool.java due to a10f8b4 + update src/java.base/share/classes/java/lang/Object.java due to a10f8b4 + update src/java.base/share/classes/java/net/DatagramSocket.java due to a6a23d6 + update src/java.base/share/classes/java/net/ServerSocket.java due to a6a23d6 + update src/java.base/share/classes/java/nio/channels/DatagramChannel.java due to a10f8b4 + update src/java.base/share/classes/java/nio/channels/FileChannel.java due to a10f8b4 + update src/java.base/share/classes/java/nio/channels/InterruptibleChannel.java due to a10f8b4 + update src/java.base/share/classes/java/nio/channels/ReadableByteChannel.java due to a10f8b4 + update src/java.base/share/classes/java/nio/channels/ScatteringByteChannel.java due to a10f8b4 + update src/java.base/share/classes/java/nio/channels/Selector.java due to a10f8b4 + update src/java.base/share/classes/java/nio/channels/ServerSocketChannel.java due to a10f8b4 + update src/java.base/share/classes/java/nio/channels/SocketChannel.java due to a10f8b4 + update src/java.base/share/classes/sun/nio/ch/Interruptible.java due to a10f8b4 + update src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java due to a10f8b4 + update src/java.desktop/share/classes/java/awt/Robot.java due to a10f8b4 + update src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java due to a10f8b4 + update src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java due to a10f8b4 + update src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java due to a10f8b4 + update src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java due to a10f8b4 + update test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadState/GetThreadStateTest.java due to a10f8b4 + update test/hotspot/jtreg/vmTestbase/nsk/jvmti/InterruptThread/intrpthrd001/TestDescription.java due to a10f8b4 + update test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI04/bi04t002/newclass02/java.base/java/lang/Object.java due to a10f8b4 + update test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t002/TestDescription.java due to a10f8b4 + update test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t003/TestDescription.java due to a10f8b4 + update test/hotspot/jtreg/vmTestbase/nsk/share/gc/AllDiag.java due to a10f8b4 + update test/hotspot/jtreg/vmTestbase/nsk/share/gc/FinDiag.java due to a10f8b4 + update test/hotspot/jtreg/vmTestbase/nsk/share/runner/MemDiag.java due to a10f8b4 + update test/jdk/java/lang/Thread/JoinWithDuration.java due to a10f8b4 + update test/jdk/java/lang/Thread/SleepWithDuration.java due to a10f8b4 + update test/jdk/java/lang/Thread/virtual/CustomScheduler.java due to a6a23d6 + update test/jdk/java/nio/channels/Channels/SocketChannelStreams.java due to a10f8b4 + update test/jdk/java/nio/channels/FileChannel/CloseDuringTransfer.java due to a10f8b4 + update test/jdk/java/nio/channels/FileChannel/ClosedByInterrupt.java due to a10f8b4 + update test/jdk/java/nio/channels/Pipe/PipeInterrupt.java due to a10f8b4 + update test/jdk/java/nio/channels/Selector/LotsOfInterrupts.java due to a10f8b4 + update test/jdk/java/nio/channels/Selector/SelectWithConsumer.java due to a10f8b4 + update test/jdk/java/nio/channels/Selector/WakeupAfterClose.java due to a10f8b4 + update test/jdk/java/nio/channels/SocketChannel/AdaptorStreams.java due to a10f8b4 + update test/jdk/java/nio/file/Files/CallWithInterruptSet.java due to a10f8b4 + update test/jdk/java/nio/file/Files/InterruptCopy.java due to a10f8b4 + update test/jdk/java/util/concurrent/CompletableFuture/LostInterrupt.java due to a10f8b4 + update test/jdk/java/util/concurrent/CompletableFuture/SwallowedInterruptedException.java due to a10f8b4 + update test/jdk/java/util/concurrent/ExecutorService/CloseTest.java due to a10f8b4 + update test/jdk/java/util/concurrent/ExecutorService/InvokeTest.java due to a10f8b4 + update test/jdk/java/util/zip/InterruptibleZip.java due to a10f8b4
RogerRiggs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Pavel, these changes look OK to me.
Over time I think it will be harder to keep track or enforce this in code comments but I think it is easier to enforce for API specification text.
Moving from "interrupted" to "interrupt" was a slow drift rather than a landslide. I think it's okay to repair it once. Loom is already in and once structured concurrency is in, I don't expect many new occurrences of "interrupt" in the foreseeable future. But you are right, the important bit is the specification, not the code comments. |
|
/integrate |
|
Going to push as commit 28f2591.
Your commit was automatically rebased without conflicts. |
|
@pavelrappo Pushed as commit 28f2591. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Throughout documentation and source code, the
Thread.interruptedflag is referred to as either "interrupted status" or "interrupt status". It might be good to be consistent.Historically, it seems to have initially been "interrupted status". This is how the flag is called in
java.lang.Threadand the "Java Concurrency in Practice" book. ("The Java Programming Language" calls it "interrupted state".) However, over the years "interrupt status" appeared in documentation and source code through networking and NIO classes.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27972/head:pull/27972$ git checkout pull/27972Update a local copy of the PR:
$ git checkout pull/27972$ git pull https://git.openjdk.org/jdk.git pull/27972/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27972View PR using the GUI difftool:
$ git pr show -t 27972Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27972.diff
Using Webrev
Link to Webrev Comment