1 /* src/native/vm/gnu/java_lang_VMThread.c - java/lang/VMThread
3 Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 Contact: cacao@cacaojvm.org
27 Authors: Roman Obermaiser
31 $Id: java_lang_VMThread.c 6228 2006-12-26 19:56:58Z twisti $
39 #include "native/jni.h"
40 #include "native/native.h"
41 #include "native/include/java_lang_ThreadGroup.h"
42 #include "native/include/java_lang_Object.h" /* java_lang_Thread.h */
43 #include "native/include/java_lang_Throwable.h" /* java_lang_Thread.h */
44 #include "native/include/java_lang_VMThread.h"
45 #include "native/include/java_lang_Thread.h"
46 #include "native/vm/java_lang_Thread.h"
48 #if defined(ENABLE_THREADS)
49 # include "threads/native/threads.h"
54 * Class: java/lang/VMThread
55 * Method: countStackFrames
58 JNIEXPORT s4 JNICALL Java_java_lang_VMThread_countStackFrames(JNIEnv *env, java_lang_VMThread *this)
60 return _Jv_java_lang_Thread_countStackFrames(this->thread);
65 * Class: java/lang/VMThread
69 JNIEXPORT void JNICALL Java_java_lang_VMThread_start(JNIEnv *env, java_lang_VMThread *this, s8 stacksize)
71 _Jv_java_lang_Thread_start(this->thread, stacksize);
76 * Class: java/lang/VMThread
80 JNIEXPORT void JNICALL Java_java_lang_VMThread_interrupt(JNIEnv *env, java_lang_VMThread *this)
82 _Jv_java_lang_Thread_interrupt(this->thread);
87 * Class: java/lang/VMThread
88 * Method: isInterrupted
91 JNIEXPORT s4 JNICALL Java_java_lang_VMThread_isInterrupted(JNIEnv *env, java_lang_VMThread *this)
93 return _Jv_java_lang_Thread_isInterrupted(this->thread);
98 * Class: java/lang/VMThread
102 JNIEXPORT void JNICALL Java_java_lang_VMThread_suspend(JNIEnv *env, java_lang_VMThread *this)
104 _Jv_java_lang_Thread_suspend(this->thread);
109 * Class: java/lang/VMThread
113 JNIEXPORT void JNICALL Java_java_lang_VMThread_resume(JNIEnv *env, java_lang_VMThread *this)
115 _Jv_java_lang_Thread_resume(this->thread);
120 * Class: java/lang/VMThread
121 * Method: nativeSetPriority
124 JNIEXPORT void JNICALL Java_java_lang_VMThread_nativeSetPriority(JNIEnv *env, java_lang_VMThread *this, s4 priority)
126 _Jv_java_lang_Thread_setPriority(this->thread, priority);
131 * Class: java/lang/VMThread
133 * Signature: (Ljava/lang/Object;)V
135 JNIEXPORT void JNICALL Java_java_lang_VMThread_nativeStop(JNIEnv *env, java_lang_VMThread *this, java_lang_Throwable *t)
137 _Jv_java_lang_Thread_stop(this->thread, t);
142 * Class: java/lang/VMThread
143 * Method: currentThread
144 * Signature: ()Ljava/lang/Thread;
146 JNIEXPORT java_lang_Thread* JNICALL Java_java_lang_VMThread_currentThread(JNIEnv *env, jclass clazz)
148 return _Jv_java_lang_Thread_currentThread();
153 * Class: java/lang/VMThread
157 JNIEXPORT void JNICALL Java_java_lang_VMThread_yield(JNIEnv *env, jclass clazz)
159 _Jv_java_lang_Thread_yield();
164 * Class: java/lang/VMThread
165 * Method: interrupted
168 JNIEXPORT s4 JNICALL Java_java_lang_VMThread_interrupted(JNIEnv *env, jclass clazz)
170 return _Jv_java_lang_Thread_interrupted();
175 * Class: java/lang/VMThread
177 * Signature: (Ljava/lang/Object;)Z
179 JNIEXPORT s4 JNICALL Java_java_lang_VMThread_holdsLock(JNIEnv *env, jclass clazz, java_lang_Object* o)
181 return _Jv_java_lang_Thread_holdsLock(o);
186 * Class: java/lang/VMThread
188 * Signature: ()Ljava/lang/String;
190 JNIEXPORT java_lang_String* JNICALL Java_java_lang_VMThread_getState(JNIEnv *env, java_lang_VMThread *this)
192 return _Jv_java_lang_Thread_getState(this->thread);
197 * These are local overrides for various environment variables in Emacs.
198 * Please do not remove this and leave it at the end of the file, where
199 * Emacs will automagically detect them.
200 * ---------------------------------------------------------------------
203 * indent-tabs-mode: t