* src/vm/jit/stack.c (stack_analyse): Do not set argintreguse to
[cacao.git] / src / vm / finalizer.c
index 00b0e24ad374e1eebd332240ab77a09c5f0ab87a..e0e69d02c0297e5ef6d67f51dc15a2c63ae81f83 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: finalizer.c 4908 2006-05-12 16:49:50Z edwin $
+   $Id: finalizer.c 5123 2006-07-12 21:45:34Z twisti $
 
 */
 
 #include "native/jni.h"
 #include "native/include/java_lang_Thread.h"
 #include "native/include/java_lang_VMThread.h"
+
+#if defined(ENABLE_THREADS)
+# include "threads/native/lock.h"
+#endif
+
 #include "vm/builtin.h"
 #include "vm/exceptions.h"
 #include "vm/global.h"
@@ -54,7 +59,7 @@
 
 /* global variables ***********************************************************/
 
-#if defined(USE_THREADS)
+#if defined(ENABLE_THREADS)
 static java_lang_VMThread *finalizer_vmthread;
 static java_objectheader *lock_finalizer_thread;
 #endif
@@ -68,12 +73,10 @@ static java_objectheader *lock_finalizer_thread;
 
 bool finalizer_init(void)
 {
-#if defined(USE_THREADS)
+#if defined(ENABLE_THREADS)
        lock_finalizer_thread = NEW(java_objectheader);
 
-# if defined(NATIVE_THREADS)
        lock_init_object_lock(lock_finalizer_thread);
-# endif
 #endif
 
        /* everything's ok */
@@ -90,13 +93,13 @@ bool finalizer_init(void)
 
 *******************************************************************************/
 
-#if defined(USE_THREADS)
+#if defined(ENABLE_THREADS)
 static void finalizer_thread(void)
 {
        while (true) {
                /* get the lock on the finalizer lock object, so we can call wait */
 
-               builtin_monitorenter(lock_finalizer_thread);
+               lock_monitor_enter(lock_finalizer_thread);
 
                /* wait forever (0, 0) on that object till we are signaled */
        
@@ -104,7 +107,7 @@ static void finalizer_thread(void)
 
                /* leave the lock */
 
-               builtin_monitorexit(lock_finalizer_thread);
+               lock_monitor_exit(lock_finalizer_thread);
 
                /* and call the finalizers */
 
@@ -120,7 +123,7 @@ static void finalizer_thread(void)
 
 *******************************************************************************/
 
-#if defined(USE_THREADS)
+#if defined(ENABLE_THREADS)
 bool finalizer_start_thread(void)
 {
        java_lang_Thread *t;
@@ -162,10 +165,10 @@ bool finalizer_start_thread(void)
 
 void finalizer_notify(void)
 {
-#if defined(USE_THREADS)
+#if defined(ENABLE_THREADS)
        /* get the lock on the finalizer lock object, so we can call wait */
 
-       builtin_monitorenter(lock_finalizer_thread);
+       lock_monitor_enter(lock_finalizer_thread);
 
        /* signal the finalizer thread */
        
@@ -173,7 +176,7 @@ void finalizer_notify(void)
 
        /* leave the lock */
 
-       builtin_monitorexit(lock_finalizer_thread);
+       lock_monitor_exit(lock_finalizer_thread);
 #else
        /* if we don't have threads, just run the finalizers */