Changes: Joseph Wenninger
Christian Thalinger
- $Id: VMObject.c 4908 2006-05-12 16:49:50Z edwin $
+ $Id: VMObject.c 4921 2006-05-15 14:24:36Z twisti $
*/
+#include "config.h"
+
#include <stdlib.h>
#include <string.h>
+#include "vm/types.h"
+
#include "mm/boehm.h"
#include "mm/memory.h"
#include "toolbox/logging.h"
#include "native/include/java_lang_Cloneable.h"
#include "native/include/java_lang_Object.h"
-#if defined(USE_THREADS)
-# if defined(NATIVE_THREADS)
-# include "threads/native/threads.h"
-# else
-# include "threads/green/threads.h"
-# include "threads/green/locks.h"
-# endif
+#if defined(ENABLE_THREADS)
+# include "threads/native/threads.h"
#endif
#include "vm/builtin.h"
new = (java_lang_Object *)
heap_allocate(size, (desc->arraytype == ARRAYTYPE_OBJECT), NULL);
- if (!new)
+ if (new == NULL)
return NULL;
MCOPY(new, this, u1, size);
-#if defined(USE_THREADS) && defined(NATIVE_THREADS)
+#if defined(ENABLE_THREADS)
lock_init_object_lock((java_objectheader *) new);
#endif
c = this->header.vftbl->class;
new = (java_lang_Object *) builtin_new(c);
- if (!new)
+ if (new == NULL)
return NULL;
MCOPY(new, this, u1, c->instancesize);
-#if defined(USE_THREADS) && defined(NATIVE_THREADS)
+#if defined(ENABLE_THREADS)
lock_init_object_lock((java_objectheader *) new);
#endif
*/
JNIEXPORT void JNICALL Java_java_lang_VMObject_notify(JNIEnv *env, jclass clazz, java_lang_Object *this)
{
-#if defined(USE_THREADS)
+#if defined(ENABLE_THREADS)
lock_notify_object(&this->header);
#endif
}
*/
JNIEXPORT void JNICALL Java_java_lang_VMObject_notifyAll(JNIEnv *env, jclass clazz, java_lang_Object *this)
{
-#if defined(USE_THREADS)
+#if defined(ENABLE_THREADS)
lock_notify_all_object(&this->header);
#endif
}
*/
JNIEXPORT void JNICALL Java_java_lang_VMObject_wait(JNIEnv *env, jclass clazz, java_lang_Object *o, s8 ms, s4 ns)
{
-#if defined(USE_THREADS)
+#if defined(ENABLE_THREADS)
lock_wait_for_object(&o->header, ms, ns);
#endif
}