< prev index next >

src/hotspot/share/prims/jvm.cpp

Print this page

        

*** 2972,2982 **** if (millis < 0) { THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "timeout value is negative"); } ! if (Thread::is_interrupted (THREAD, true) && !HAS_PENDING_EXCEPTION) { THROW_MSG(vmSymbols::java_lang_InterruptedException(), "sleep interrupted"); } // Save current thread state and restore it at the end of this block. // And set new thread state to SLEEPING. --- 2972,2982 ---- if (millis < 0) { THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "timeout value is negative"); } ! if (thread->is_interrupted(true) && !HAS_PENDING_EXCEPTION) { THROW_MSG(vmSymbols::java_lang_InterruptedException(), "sleep interrupted"); } // Save current thread state and restore it at the end of this block. // And set new thread state to SLEEPING.
*** 3069,3079 **** ThreadsListHandle tlh(thread); JavaThread* receiver = NULL; bool is_alive = tlh.cv_internal_thread_to_JavaThread(jthread, &receiver, NULL); if (is_alive) { // jthread refers to a live JavaThread. ! Thread::interrupt(receiver); } JVM_END JVM_ENTRY(jboolean, JVM_IsInterrupted(JNIEnv* env, jobject jthread, jboolean clear_interrupted)) --- 3069,3079 ---- ThreadsListHandle tlh(thread); JavaThread* receiver = NULL; bool is_alive = tlh.cv_internal_thread_to_JavaThread(jthread, &receiver, NULL); if (is_alive) { // jthread refers to a live JavaThread. ! receiver->interrupt(); } JVM_END JVM_ENTRY(jboolean, JVM_IsInterrupted(JNIEnv* env, jobject jthread, jboolean clear_interrupted))
*** 3082,3092 **** ThreadsListHandle tlh(thread); JavaThread* receiver = NULL; bool is_alive = tlh.cv_internal_thread_to_JavaThread(jthread, &receiver, NULL); if (is_alive) { // jthread refers to a live JavaThread. ! return (jboolean) Thread::is_interrupted(receiver, clear_interrupted != 0); } else { return JNI_FALSE; } JVM_END --- 3082,3092 ---- ThreadsListHandle tlh(thread); JavaThread* receiver = NULL; bool is_alive = tlh.cv_internal_thread_to_JavaThread(jthread, &receiver, NULL); if (is_alive) { // jthread refers to a live JavaThread. ! return (jboolean) receiver->is_interrupted(clear_interrupted != 0); } else { return JNI_FALSE; } JVM_END
< prev index next >