> 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 one 
additional commit since the last revision:

  keep default state as NEW

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

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

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

  Stats: 7 lines in 1 file changed: 1 ins; 1 del; 5 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