Skip to content

Conversation

@pavelrappo
Copy link
Member

@pavelrappo pavelrappo commented Oct 24, 2025

Throughout documentation and source code, the Thread.interrupted flag 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.Thread and 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

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8370568: Refer to Thread.interrupted as "interrupted status" consistently (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27972/head:pull/27972
$ git checkout pull/27972

Update a local copy of the PR:
$ git checkout pull/27972
$ git pull https://git.openjdk.org/jdk.git pull/27972/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27972

View PR using the GUI difftool:
$ git pr show -t 27972

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27972.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 24, 2025

👋 Welcome back prappo! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Oct 24, 2025

@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:

8370568: Refer to Thread.interrupted as "interrupted status" consistently

Reviewed-by: jpai, rriggs, alanb

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 master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk
Copy link

openjdk bot commented Oct 24, 2025

@pavelrappo The following labels will be automatically applied to this pull request:

  • build
  • client
  • compiler
  • core-libs
  • hotspot-gc
  • net
  • nio
  • security
  • serviceability

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.

@pavelrappo pavelrappo marked this pull request as ready for review October 27, 2025 17:47
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 27, 2025
@mlbridge
Copy link

mlbridge bot commented Oct 27, 2025

Webrevs

Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 27, 2025
Copy link
Contributor

@AlanBateman AlanBateman left a 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
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Oct 28, 2025
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 28, 2025
Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup.

Copy link
Member

@jaikiran jaikiran left a 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.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Oct 29, 2025
@pavelrappo
Copy link
Member Author

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.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 29, 2025
@pavelrappo
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 29, 2025

Going to push as commit 28f2591.
Since your change was applied there have been 8 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 29, 2025
@openjdk openjdk bot closed this Oct 29, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 29, 2025
@openjdk
Copy link

openjdk bot commented Oct 29, 2025

@pavelrappo Pushed as commit 28f2591.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants