> Please review the following small fix. When trying to get the snapshot of a 
> platform thread, we can find the `JavaThread` in the created 
> `ThreadsListHandle`, but before executing the 
> `GetThreadSnapshotHandshakeClosure` the target might have already set its 
> `_terminated` field to `_thread_terminated`. In that case the 
> `Handshake::execute` call will return without the closure being executed. 
> Since `cl._thread_status` is initialized to `JavaThreadStatus::NEW` we hit 
> the next assert in the code.
> 
> The proposed fix is to initialize `cl._thread_status` to 
> `JavaThreadStatus::TERMINATED` instead.
> 
> I added new test `ThreadExiting.java` which reliably reproduces the issue.
> 
> Thanks,
> Patricio
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Patricio Chilano Mateo has updated the pull request incrementally with two 
additional commits since the last revision:

 - Remove Helper.java
 - Verify closure is executed

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/30903/files
  - new: https://git.openjdk.org/jdk/pull/30903/files/305a58ee..f9e077fd

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=30903&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=30903&range=00-01

  Stats: 53 lines in 5 files changed: 3 ins; 40 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/30903.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/30903/head:pull/30903

PR: https://git.openjdk.org/jdk/pull/30903

Reply via email to