java.lang.Thread.
Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
Licensed under the Apache License, Version 2.0 ("the License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
Definition in file jlThread.c.
#include "arch.h"
#include "jvmcfg.h"
#include "classfile.h"
#include "jvm.h"
#include "jvmclass.h"
#include "linkage.h"
Go to the source code of this file.
Native implementation of object instance functions. | |||||||||||||
The object hash of this object is always passed as the first parameter. | |||||||||||||
jboolean | jlThread_checkAccess (jvm_object_hash objhashthis) | ||||||||||||
JNI hook to checkAccess(). | |||||||||||||
jint | jlThread_countStackFrames (jvm_object_hash objhashthis) | ||||||||||||
JNI hook to countStackFrames(). | |||||||||||||
jboolean | jlThread_destroy (jvm_object_hash objhashthis) | ||||||||||||
JNI hook to destroy(). | |||||||||||||
jint | jlThread_getPriority (jvm_object_hash objhashthis) | ||||||||||||
JNI hook to getPriority(). | |||||||||||||
jboolean | jlThread_interrupt (jvm_object_hash objhashthis) | ||||||||||||
JNI hook to interrupt(). | |||||||||||||
jboolean | jlThread_isAlive (jvm_object_hash objhashthis) | ||||||||||||
JNI hook to jointimed(). | |||||||||||||
jboolean | jlThread_isDaemon (jvm_object_hash objhashthis) | ||||||||||||
JNI hook to isDaemon(). | |||||||||||||
jboolean | jlThread_isInterrupted (jvm_object_hash objhashthis) | ||||||||||||
JNI hook to isInterrupted(). | |||||||||||||
jvoid | jlThread_resume (jvm_object_hash objhashthis) | ||||||||||||
JNI hook to resume(). | |||||||||||||
jvoid | jlThread_setDaemon (jvm_object_hash objhashthis, jboolean isdaemon) | ||||||||||||
JNI hook to setDaemon(). | |||||||||||||
jboolean | jlThread_setPriority (jvm_object_hash objhashthis, jint priority) | ||||||||||||
JNI hook to setPriority(). | |||||||||||||
jboolean | jlThread_start (jvm_object_hash objhashthis) | ||||||||||||
JNI hook to start(). | |||||||||||||
jvoid | jlThread_stop (jvm_object_hash objhashthis) | ||||||||||||
JNI hook to stop(). | |||||||||||||
jvoid | jlThread_suspend (jvm_object_hash objhashthis) | ||||||||||||
JNI hook to suspend(). | |||||||||||||
Native implementation of class static functions. | |||||||||||||
The class index of the current class is always passed as the first parameter.
| |||||||||||||
jvm_object_hash | jlThread_currentThread (jvm_class_index clsidxthis) | ||||||||||||
JNI hook to currentThread(). | |||||||||||||
jboolean | jlThread_holdsLock (jvm_class_index clsidxthis, jvm_object_hash objhashLOCK) | ||||||||||||
JNI hook to holdsLock(). | |||||||||||||
jboolean | jlThread_interrupted (jvm_class_index clsidxthis) | ||||||||||||
Native implementation of java.lang.Thread.interrupted(). | |||||||||||||
jboolean | jlThread_yield (jvm_class_index clsidxthis) | ||||||||||||
JNI hook to yield(). | |||||||||||||
Native implementation of java.lang.Thread.join() functions. | |||||||||||||
Join one thread onto another, timed and untimed. Results are undefined if thread has the JOIN4EVER, JOINTIMED, WAIT4EVER, WAITTIMED, or INTERRUPTIBLEIO status or if thread has been NOTIFIED or INTERRUPTED. This will only succeed if thread is in RUNNING state.
The
The object hash of
| |||||||||||||
jvoid | jlThread_join4ever (jvm_object_hash objhashthis) | ||||||||||||
JNI hook to join4ever(). | |||||||||||||
jvoid | jlThread_jointimed (jvm_object_hash objhashthis, jlong sleeptime) | ||||||||||||
JNI hook to jointimed(). | |||||||||||||
jvoid | jlThread_jointimed_nanos (jvm_object_hash objhashthis, jlong sleeptime, jint sleeptime_nanoseconds) | ||||||||||||
JNI hook to jointimed_nanos(). | |||||||||||||
Native implementation of java.lang.Thread.sleep() functions. | |||||||||||||
Sleep based on millisecond timer ticks. Results are undefined if thread has the JOIN4EVER, JOINTIMED, WAIT4EVER, WAITTIMED, or INTERRUPTIBLEIO status or if thread has been NOTIFIED or INTERRUPTED. This will only succeed if thread is in RUNNING state.
The The class index of the current class is always passed as the first parameter.
| |||||||||||||
jvoid | jlThread_sleep (jvm_class_index clsidxthis, jlong sleeptime_milliseconds) | ||||||||||||
JNI hook to sleep(). | |||||||||||||
jvoid | jlThread_sleep_nanos (jvm_class_index clsidxthis, jlong sleeptime_milliseconds, jint sleeptime_nanoseconds) | ||||||||||||
JNI hook to sleep_nanos(). | |||||||||||||
Functions | |||||||||||||
static void | jlThread_c_dummy (void) | ||||||||||||
Variables | |||||||||||||
static char * | jlThread_c_copyright = "\0" "$URL: https://svn.apache.org/path/name/jlThread.c $ $Id: jlThread.c 0 09/28/2005 dlydick $" " " "Copyright 2005 The Apache Software Foundation or its licensors, as applicable." |
|
Definition at line 48 of file jlThread.c. |
|
JNI hook to sleep(). < Access structures of the thread now running in the JVM. < thread is sleeping Definition at line 117 of file jlThread.c. References CURRENT_THREAD, THREAD, THREAD_STATUS_SLEEP, and threadstate_request_runnable(). Referenced by Java_java_lang_Thread_sleep__J(), jlThread_sleep_nanos(), and native_run_local_return_jint(). |
|
JNI hook to sleep_nanos(). Ignore the sleeptime_nanoseconds parameter in this implementation. Definition at line 143 of file jlThread.c. References jlThread_sleep(). Referenced by Java_java_lang_Thread_sleep__JI(), and native_run_local_return_jint(). |
|
JNI hook to join4ever(). < Access structures of the thread now running in the JVM. < This slot contains an object
< Object is a Definition at line 201 of file jlThread.c. Referenced by Java_java_lang_Thread_join(), and native_run_local_return_jvoid(). |
|
JNI hook to jointimed(). < Access structures of the thread now running in the JVM. < This slot contains an object
< Object is a Definition at line 228 of file jlThread.c. Referenced by Java_java_lang_Thread_join__J(), and native_run_local_return_jvoid(). |
|
JNI hook to jointimed_nanos(). Ignore the sleeptime_nanoseconds parameter in this implementation. Definition at line 259 of file jlThread.c. References CURRENT_THREAD, and THREAD. Referenced by Java_java_lang_Thread_join__JI(), and native_run_local_return_jvoid(). |
|
JNI hook to currentThread().
Definition at line 308 of file jlThread.c. References CURRENT_THREAD, jfalse, threadstate_request_badlogic(), and threadstate_request_runnable(). Referenced by Java_java_lang_Thread_currentThread(), and native_run_local_return_jobject(). |
|
JNI hook to yield().
Definition at line 332 of file jlThread.c. References CURRENT_THREAD, jfalse, jtrue, THREAD, and THREAD_STATUS_INTERRUPTED. Referenced by Java_java_lang_Thread_yield(), and native_run_local_return_jvoid(). |
|
Native implementation of Status is CLEARED by this method after testing it.
< thread has been interrupted < thread has been interrupted Definition at line 374 of file jlThread.c. References CURRENT_THREAD, jtrue, jvm_object_hash_null, JVMCLASS_JAVA_LANG_NULLPOINTEREXCEPTION, rtrue, THREAD_STATUS_THREW_EXCEPTION, thread_throw_exception(), and threadutil_holds_lock(). Referenced by Java_java_lang_Thread_interrupted(), and native_run_local_return_jint(). |
|
JNI hook to holdsLock().
< thread threw a < Access structures of the thread now running in the JVM. Definition at line 418 of file jlThread.c. Referenced by Java_java_lang_Thread_holdsLock(), and native_run_local_return_jint(). |
|
JNI hook to interrupt(). The THREAD_STATUS_INTERRUPTED bit is unconditionally set here. The logic for clearing the bit and throwing exceptions is performed when this bit is read by other functions.
< Object is a
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < Access structures of the thread now running in the JVM.
< thread threw a Definition at line 498 of file jlThread.c. References jfalse, jtrue, OBJECT_THREAD_LINKAGE, rtrue, THREAD, THREAD_STATUS_INTERRUPTED, VERIFY_OBJECT_THREAD_LINKAGE, and VERIFY_THREAD_LINKAGE. Referenced by Java_java_lang_Thread_interrupt(), and native_run_local_return_jvoid(). |
|
JNI hook to isInterrupted(). Status is UNCHANGED by this method after testing it.
< Object is a
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a Definition at line 565 of file jlThread.c. Referenced by Java_java_lang_Thread_isInterrupted(), and native_run_local_return_jint(). |
|
JNI hook to jointimed().
< Object is a
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a Definition at line 627 of file jlThread.c. References CHECK_FINAL_STACK_FRAME_GENERIC, FIRST_STACK_FRAME, JVMCLASS_JAVA_LANG_ILLEGALTHREADSTATEEXCEPTION, NEXT_STACK_FRAME_GENERIC, OBJECT_THREAD_LINKAGE, rfalse, THREAD, THREAD_STATUS_INTERRUPTED, THREAD_STATUS_THREW_EXCEPTION, thread_throw_exception(), VERIFY_OBJECT_THREAD_LINKAGE, and VERIFY_THREAD_LINKAGE. Referenced by Java_java_lang_Thread_isAlive(), and native_run_local_return_jint(). |
|
JNI hook to start(). This will only succeed if thread is in NEW state.
< Object is a
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a Definition at line 687 of file jlThread.c. References CURRENT_THREAD, jfalse, jtrue, JVMCLASS_JAVA_LANG_ILLEGALARGUMENTEXCEPTION, JVMCLASS_JAVA_LANG_SECURITYEXCEPTION, OBJECT_THREAD_LINKAGE, rtrue, THREAD, THREAD_PRIORITY_MAX, THREAD_PRIORITY_MIN, THREAD_STATUS_THREW_EXCEPTION, thread_throw_exception(), VERIFY_OBJECT_THREAD_LINKAGE, and VERIFY_THREAD_LINKAGE. Referenced by Java_java_lang_Thread_start(), and native_run_local_return_jint(). |
|
JNI hook to countStackFrames().
< Object is a
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a
< thread threw a Definition at line 742 of file jlThread.c. References OBJECT_THREAD_LINKAGE, rtrue, THREAD, THREAD_PRIORITY_BAD, VERIFY_OBJECT_THREAD_LINKAGE, and VERIFY_THREAD_LINKAGE. Referenced by Java_java_lang_Thread_countStackFrames(), and native_run_local_return_jint(). |
|
JNI hook to setPriority().
< thread threw a < This slot contains an object
< Object is a
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a Definition at line 831 of file jlThread.c. References CURRENT_THREAD, jfalse, jtrue, JVMCLASS_JAVA_LANG_SECURITYEXCEPTION, OBJECT_THREAD_LINKAGE, rtrue, THREAD_STATUS_THREW_EXCEPTION, thread_throw_exception(), VERIFY_OBJECT_THREAD_LINKAGE, and VERIFY_THREAD_LINKAGE. Referenced by Java_java_lang_Thread_setPriority(), and native_run_local_return_jint(). |
|
JNI hook to getPriority().
< Object is a
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a Definition at line 914 of file jlThread.c. References CURRENT_THREAD, JVMCLASS_JAVA_LANG_SECURITYEXCEPTION, THREAD_STATUS_THREW_EXCEPTION, and thread_throw_exception(). Referenced by Java_java_lang_Thread_getPriority(), and native_run_local_return_jint(). |
|
JNI hook to destroy(). Simply kill the thread without any cleanup. THIS IS A VERY BAD THING! (Perhaps this is why most JDK's do not implement this method any more!)
There is typically no implementation done of
< Object is a
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a Definition at line 973 of file jlThread.c. References jfalse, jtrue, OBJECT_THREAD_LINKAGE, THREAD, and THREAD_STATUS_ISDAEMON. Referenced by Java_java_lang_Thread_destroy(), and native_run_local_return_jint(). |
|
JNI hook to checkAccess(). This method will always give permission in this JVM.
< Object is a
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< thread threw a Definition at line 1037 of file jlThread.c. References OBJECT_THREAD_LINKAGE, rtrue, THREAD, VERIFY_OBJECT_THREAD_LINKAGE, and VERIFY_THREAD_LINKAGE. Referenced by Java_java_lang_Thread_checkAccess(), and native_run_local_return_jint(). |
|
JNI hook to setDaemon().
< Object is a
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< thread threw a < This slot contains an object
< Object is a < Daemon thread state, vs user thread, per Thread.isdaemon()
< thread threw a Definition at line 1136 of file jlThread.c. References CURRENT_THREAD, JVMCLASS_JAVA_LANG_SECURITYEXCEPTION, OBJECT_THREAD_LINKAGE, rtrue, THREAD, THREAD_STATUS_SUSPEND, THREAD_STATUS_THREW_EXCEPTION, thread_throw_exception(), threadstate_activate_badlogic(), threadstate_request_badlogic(), threadstate_request_blockingevent(), VERIFY_OBJECT_THREAD_LINKAGE, and VERIFY_THREAD_LINKAGE. Referenced by Java_java_lang_Thread_setDaemon(), and native_run_local_return_jvoid(). |
|
JNI hook to isDaemon().
< Object is a
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a Definition at line 1230 of file jlThread.c. References CURRENT_THREAD, JVMCLASS_JAVA_LANG_SECURITYEXCEPTION, OBJECT_THREAD_LINKAGE, rtrue, THREAD, THREAD_STATE_BADLOGIC, THREAD_STATE_BLOCKED, THREAD_STATE_BLOCKINGEVENT, THREAD_STATUS_SUSPEND, THREAD_STATUS_THREW_EXCEPTION, thread_throw_exception(), threadstate_activate_blocked(), threadstate_activate_blockingevent(), threadstate_process_blocked(), threadstate_process_blockingevent(), threadstate_request_blocked(), threadstate_request_blockingevent(), threadstate_request_unblocked(), VERIFY_OBJECT_THREAD_LINKAGE, and VERIFY_THREAD_LINKAGE. Referenced by Java_java_lang_Thread_isDaemon(), and native_run_local_return_jint(). |
|
JNI hook to stop().
There is typically no native implementation of
< Object is a
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< thread threw a < This slot contains an object
< Object is a < Object monitor locked by mlock_thridx < Object monitor locked by mlock_thridx Definition at line 1364 of file jlThread.c. Referenced by Java_java_lang_Thread_stop(), and native_run_local_return_jvoid(). |
|
JNI hook to suspend(). Results are undefined if thread has the SLEEP, WAIT4EVER, WAITTIMED, or INTERRUPTIBLEIO status or if thread has been NOTIFIED or INTERRUPTED. This will work if thread is in any state at all.
< Object is a
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < Access structures of the thread now running in the JVM.
< thread threw a Definition at line 1476 of file jlThread.c. Referenced by Java_java_lang_Thread_suspend(), and native_run_local_return_jvoid(). |
|
JNI hook to resume(). Results are undefined if thread has the SLEEP, WAIT4EVER, WAITTIMED, or INTERRUPTIBLEIO status or if thread has been NOTIFIED or INTERRUPTED. This will work if thread is in any state at all.
< Object is a
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < This slot contains an object
< Object is a < This slot contains an object
< Object is a
< Object is a < Access structures of the thread now running in the JVM.
< thread threw a Definition at line 1568 of file jlThread.c. Referenced by Java_java_lang_Thread_resume(), and native_run_local_return_jvoid(). |
|
Definition at line 48 of file jlThread.c. |