* src/native/llni.h: Added LLNI (low level native interface).
[cacao.git] / src / native / vm / java_lang_Thread.c
index 5b5f266488aa315f487ad2fe63c49e74b17ad49f..0742d1740487e38bcd1b11ad6ea4684875f61bcc 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_Thread.c 8272 2007-08-08 14:55:00Z twisti $
+   $Id: java_lang_Thread.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
@@ -31,6 +31,7 @@
 #include "vm/types.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_String.h"
@@ -108,7 +109,7 @@ void _Jv_java_lang_Thread_interrupt(java_lang_Thread *this)
        threadobject *thread;
 
 #if defined(WITH_CLASSPATH_GNU)
-       thread = (threadobject *) this->vmThread->vmdata;
+       thread = (threadobject *) LLNI_field_direct(LLNI_field_direct(this, vmThread), vmdata);
 #elif defined(WITH_CLASSPATH_CLDC1_1)
        thread = (threadobject *) this->vm_thread;
 #endif
@@ -130,7 +131,7 @@ s4 _Jv_java_lang_Thread_isAlive(java_lang_Thread *this)
 
 # if defined(WITH_CLASSPATH_GNU)
 
-       t = (threadobject *) this->vmThread->vmdata;
+       t = (threadobject *) LLNI_field_direct(LLNI_field_direct(this, vmThread), vmdata);
 
 # elif defined(WITH_CLASSPATH_SUN)
 
@@ -178,7 +179,7 @@ s4 _Jv_java_lang_Thread_isInterrupted(java_lang_Thread *this)
        threadobject *t;
 
 # if defined(WITH_CLASSPATH_GNU)
-       t = (threadobject *) this->vmThread->vmdata;
+       t = (threadobject *) LLNI_field_direct(LLNI_field_direct(this, vmThread), vmdata);
 # elif defined(WITH_CLASSPATH_SUN)
        /* XXX this is just a quick hack */
 
@@ -234,7 +235,7 @@ void _Jv_java_lang_Thread_setPriority(java_lang_Thread *this, s4 priority)
        threadobject *t;
 
 # if defined(WITH_CLASSPATH_GNU)
-       t = (threadobject *) this->vmThread->vmdata;
+       t = (threadobject *) LLNI_field_direct(LLNI_field_direct(this, vmThread), vmdata);
 # elif defined(WITH_CLASSPATH_SUN)
        /* XXX this is just a quick hack */
 
@@ -298,13 +299,13 @@ java_lang_Thread *_Jv_java_lang_Thread_currentThread(void)
                log_text("t ptr is NULL\n");
 
 # if defined(ENABLE_JAVASE)
-       if (t->group == NULL) {
+       if (LLNI_field_direct(t, group) == NULL) {
                /* ThreadGroup of currentThread is not initialized */
 
-               t->group = (java_lang_ThreadGroup *)
+               LLNI_field_direct(t, group) = (java_lang_ThreadGroup *)
                        native_new_and_init(class_java_lang_ThreadGroup);
 
-               if (t->group == NULL)
+               if (LLNI_field_direct(t, group) == NULL)
                        log_text("unable to create ThreadGroup");
        }
 # endif
@@ -384,7 +385,7 @@ java_lang_String *_Jv_java_lang_Thread_getState(java_lang_Thread *this)
        java_objectheader *o;
 
 # if defined(WITH_CLASSPATH_GNU)
-       thread = (threadobject *) this->vmThread->vmdata;
+       thread = (threadobject *) LLNI_field_direct(LLNI_field_direct(this, vmThread), vmdata);
 # elif defined(WITH_CLASSPATH_CLDC1_1)
        thread = (threadobject *) this->vm_thread;
 # endif