Mercurial > hg > truffle
comparison src/share/vm/graal/graalRuntime.cpp @ 14608:682fba1bcf95
add missing null check in is_interrupted
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Tue, 18 Mar 2014 15:35:15 -0700 |
parents | d8143c431d63 |
children | 0cb5c4d276d4 |
comparison
equal
deleted
inserted
replaced
14607:7573ba6dfba2 | 14608:682fba1bcf95 |
---|---|
537 JRT_ENTRY(jboolean, GraalRuntime::thread_is_interrupted(JavaThread* thread, oopDesc* receiver, jboolean clear_interrupted)) | 537 JRT_ENTRY(jboolean, GraalRuntime::thread_is_interrupted(JavaThread* thread, oopDesc* receiver, jboolean clear_interrupted)) |
538 // Ensure that the C++ Thread and OSThread structures aren't freed before we operate | 538 // Ensure that the C++ Thread and OSThread structures aren't freed before we operate |
539 Handle receiverHandle(thread, receiver); | 539 Handle receiverHandle(thread, receiver); |
540 MutexLockerEx ml(thread->threadObj() == (void*)receiver ? NULL : Threads_lock); | 540 MutexLockerEx ml(thread->threadObj() == (void*)receiver ? NULL : Threads_lock); |
541 JavaThread* receiverThread = java_lang_Thread::thread(receiverHandle()); | 541 JavaThread* receiverThread = java_lang_Thread::thread(receiverHandle()); |
542 return (jint) Thread::is_interrupted(receiverThread, clear_interrupted != 0); | 542 if (receiverThread == NULL) { |
543 // The other thread may exit during this process, which is ok so return false. | |
544 return JNI_FALSE; | |
545 } else { | |
546 return (jint) Thread::is_interrupted(receiverThread, clear_interrupted != 0); | |
547 } | |
543 JRT_END | 548 JRT_END |
544 | 549 |
545 // JVM_InitializeGraalRuntime | 550 // JVM_InitializeGraalRuntime |
546 JVM_ENTRY(jobject, JVM_InitializeGraalRuntime(JNIEnv *env, jclass graalclass)) | 551 JVM_ENTRY(jobject, JVM_InitializeGraalRuntime(JNIEnv *env, jclass graalclass)) |
547 return VMToCompiler::graalRuntimePermObject(); | 552 return VMToCompiler::graalRuntimePermObject(); |