#include "thread.h"
#include "locks.h"
+#include "builtin.h"
#include "tables.h"
#include "native.h"
static classinfo *class_java_lang_IllegalMonitorStateException;
-#if 1
-#define DBG(s)
-#else
-#define DBG(s) s
-#endif
-
extern thread* currentThread;
-#if defined(USE_INTERNAL_THREADS)
-
mutexHashEntry *mutexHashTable;
int mutexHashTableSize;
long mutexHashMask;
}
/* Load exception classes */
- class_java_lang_IllegalMonitorStateException =
- loader_load(unicode_new_char("java/lang/IllegalMonitorStateException"));
+ loader_load_sysclass(&class_java_lang_IllegalMonitorStateException,
+ utf_new_char("java/lang/IllegalMonitorStateException"));
}
/*
void
internal_lock_mutex(iMux* mux)
{
- assert(blockInts == 1);
+ assert(blockInts > 0);
if (mux->holder == 0)
{
{
thread* tid;
- assert(blockInts == 1);
+ assert(blockInts > 0);
assert(mux->holder == currentThread);
DBG( fprintf(stderr, "waiting on %p\n", cv); );
if (mux->holder != currentThread) {
- exceptionptr = native_new_and_init(class_java_lang_IllegalMonitorStateException);
+ *exceptionptr = native_new_and_init(class_java_lang_IllegalMonitorStateException);
}
- assert(blockInts == 1);
+ assert(blockInts > 0);
count = mux->count;
mux->holder = 0;
}
if (cv->mux->holder != currentThread) {
- exceptionptr = native_new_and_init(class_java_lang_IllegalMonitorStateException);
+ *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) {
}
if (cv->mux->holder != currentThread) {
- exceptionptr = native_new_and_init(class_java_lang_IllegalMonitorStateException);
+ *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) {
cv->cvWaiters = 0;
}
}
-
-#endif