English translation
[cacao.git] / threads / locks.c
index f921f47b7241f3853e7de07a6070aa3ec4b4f78e..041113fde21f0188089202ae9141eec000bb14ee 100644 (file)
  * Written by Tim Wilkinson <tim@tjwassoc.demon.co.uk>, 1996.
  */
 
+#include "config.h"
+
 #include <assert.h>
 #include <stdio.h>
 
 #include "thread.h"
 #include "locks.h"
 
-#include "../tables.h"
-#include "../native.h"
-#include "../loader.h"
+#include "tables.h"
+#include "native.h"
+#include "loader.h"
 
 static classinfo *class_java_lang_IllegalMonitorStateException;
 
@@ -99,7 +101,7 @@ initLocks (void)
 
        /* Load exception classes */
        class_java_lang_IllegalMonitorStateException =
-               loader_load(unicode_new_char("java/lang/IllegalMonitorStateException"));
+               loader_load(utf_new_char("java/lang/IllegalMonitorStateException"));
 }
 
 /*
@@ -419,7 +421,7 @@ broadcast_cond (iCv *cond)
 void
 internal_lock_mutex(iMux* mux)
 {
-       assert(blockInts == 1);
+       assert(blockInts > 0);
 
     if (mux->holder == 0)
     {
@@ -450,7 +452,7 @@ internal_unlock_mutex(iMux* mux)
 {
     thread* tid;
 
-       assert(blockInts == 1);
+       assert(blockInts > 0);
 
     assert(mux->holder == currentThread);
     
@@ -483,7 +485,7 @@ internal_wait_cond(iMux* mux, iCv* cv, s8 timeout)
                exceptionptr = native_new_and_init(class_java_lang_IllegalMonitorStateException);
     }
 
-       assert(blockInts == 1);
+       assert(blockInts > 0);
 
     count = mux->count;
     mux->holder = 0;
@@ -527,7 +529,7 @@ internal_signal_cond (iCv* cv)
                exceptionptr = native_new_and_init(class_java_lang_IllegalMonitorStateException);
     }
 
-       assert(blockInts == 1);
+       assert(blockInts > 0);
 
     /* Remove one thread from cv list */
     if (cv->cvWaiters != 0) {
@@ -559,7 +561,7 @@ internal_broadcast_cond (iCv* cv)
                exceptionptr = native_new_and_init(class_java_lang_IllegalMonitorStateException);
     }
 
-       assert(blockInts == 1);
+       assert(blockInts > 0);
 
     /* Find the end of the cv list */
     if (cv->cvWaiters) {