mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +02:00
8230424: Use platform independent code for Thread.interrupt support
8231094: os::sleep in assert message should be changed to JavaThread::sleep Reviewed-by: rehn, dcubed
This commit is contained in:
parent
f94f7f2212
commit
5bca86f9f4
15 changed files with 129 additions and 155 deletions
|
@ -1205,7 +1205,7 @@ void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) {
|
|||
EventJavaMonitorWait event;
|
||||
|
||||
// check for a pending interrupt
|
||||
if (interruptible && Thread::is_interrupted(Self, true) && !HAS_PENDING_EXCEPTION) {
|
||||
if (interruptible && jt->is_interrupted(true) && !HAS_PENDING_EXCEPTION) {
|
||||
// post monitor waited event. Note that this is past-tense, we are done waiting.
|
||||
if (JvmtiExport::should_post_monitor_waited()) {
|
||||
// Note: 'false' parameter is passed here because the
|
||||
|
@ -1275,7 +1275,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 && (Thread::is_interrupted(THREAD, false) || HAS_PENDING_EXCEPTION)) {
|
||||
if (interruptible && (jt->is_interrupted(false) || HAS_PENDING_EXCEPTION)) {
|
||||
// Intentionally empty
|
||||
} else if (node._notified == 0) {
|
||||
if (millis <= 0) {
|
||||
|
@ -1401,7 +1401,7 @@ void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) {
|
|||
if (!WasNotified) {
|
||||
// no, it could be timeout or Thread.interrupt() or both
|
||||
// check for interrupt event, otherwise it is timeout
|
||||
if (interruptible && Thread::is_interrupted(Self, true) && !HAS_PENDING_EXCEPTION) {
|
||||
if (interruptible && jt->is_interrupted(true) && !HAS_PENDING_EXCEPTION) {
|
||||
THROW(vmSymbols::java_lang_InterruptedException());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue