mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +02:00
8233549: Thread interrupted state must only be accessed when not in a safepoint-safe state
Reviewed-by: dcubed, sspitsyn
This commit is contained in:
parent
c0d097eac6
commit
697a87460d
8 changed files with 114 additions and 94 deletions
|
@ -1267,6 +1267,10 @@ void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) {
|
|||
|
||||
int ret = OS_OK;
|
||||
int WasNotified = 0;
|
||||
|
||||
// Need to check interrupt state whilst still _thread_in_vm
|
||||
bool interrupted = interruptible && jt->is_interrupted(false);
|
||||
|
||||
{ // State transition wrappers
|
||||
OSThread* osthread = Self->osthread();
|
||||
OSThreadWaitState osts(osthread, true);
|
||||
|
@ -1275,7 +1279,7 @@ void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) {
|
|||
// Thread is in thread_blocked state and oop access is unsafe.
|
||||
jt->set_suspend_equivalent();
|
||||
|
||||
if (interruptible && (jt->is_interrupted(false) || HAS_PENDING_EXCEPTION)) {
|
||||
if (interrupted || HAS_PENDING_EXCEPTION) {
|
||||
// Intentionally empty
|
||||
} else if (node._notified == 0) {
|
||||
if (millis <= 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue