mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8305425: Thread.isAlive0 doesn't need to call into the VM
Co-authored-by: Aleksey Shipilev <shade@openjdk.org> Reviewed-by: shade, coleenp, alanb
This commit is contained in:
parent
b5d204c3a4
commit
35cb303a2c
7 changed files with 130 additions and 19 deletions
|
@ -739,7 +739,9 @@ static void ensure_join(JavaThread* thread) {
|
|||
// Thread is exiting. So set thread_status field in java.lang.Thread class to TERMINATED.
|
||||
java_lang_Thread::set_thread_status(threadObj(), JavaThreadStatus::TERMINATED);
|
||||
// Clear the native thread instance - this makes isAlive return false and allows the join()
|
||||
// to complete once we've done the notify_all below
|
||||
// to complete once we've done the notify_all below. Needs a release() to obey Java Memory Model
|
||||
// requirements.
|
||||
OrderAccess::release();
|
||||
java_lang_Thread::set_thread(threadObj(), nullptr);
|
||||
lock.notify_all(thread);
|
||||
// Ignore pending exception, since we are exiting anyway
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue