* src/vm/suck.h (list_classpath_entry): Use mutex instead of java object for
authorMichael Starzinger <michi@complang.tuwien.ac.at>
Fri, 22 Aug 2008 17:01:00 +0000 (19:01 +0200)
committerMichael Starzinger <michi@complang.tuwien.ac.at>
Fri, 22 Aug 2008 17:01:00 +0000 (19:01 +0200)
locking. Renamed member header to mutex.
* src/vm/suck.c: Adapted to above change.
* src/vm/loader.cpp: Likewise.
* src/native/vm/cldc1.1/com_sun_cldc_io_ResourceInputStream.cpp: Likewise.

src/native/vm/cldc1.1/com_sun_cldc_io_ResourceInputStream.cpp
src/vm/loader.cpp
src/vm/suck.c
src/vm/suck.h

index 9bf34ad9919f83728b338ecd4887c250ddf3f302..9aa25a547afdc958577372e98553fdb385a2e87a 100644 (file)
@@ -41,7 +41,7 @@
 # include "native/include/com_sun_cldc_io_ResourceInputStream.h"
 #endif
 
-#include "threads/lock-common.h"
+#include "threads/mutex.hpp"
 
 #include "vm/jit/builtin.hpp"
 #include "vm/exceptions.hpp"
@@ -212,13 +212,13 @@ JNIEXPORT jobject JNICALL Java_com_sun_cldc_io_ResourceInputStream_open(JNIEnv *
                if (lce->type == CLASSPATH_ARCHIVE) {
 
                        /* enter a monitor on zip/jar archives */
-                       LOCK_MONITOR_ENTER(lce);
+                       lce->mutex->lock();
 
                        /* try to get the file in current archive */
                        descriptor = zip_read_resource(lce, uname);
 
                        /* leave the monitor */
-                       LOCK_MONITOR_EXIT(lce);
+                       lce->mutex->unlock();
                        
                        if (descriptor != NULL) { /* file exists */
                                break;
index e7417acaad154872063f86c12764645c4951eb8a..71d5e9c7e8a1c0c52d797b18e192199c9cf4b502 100644 (file)
@@ -36,7 +36,6 @@
 
 #include "native/llni.h"
 
-#include "threads/lock-common.h"
 #include "threads/mutex.hpp"
 
 #include "toolbox/hashtable.h"
@@ -110,7 +109,7 @@ void loader_preinit(void)
        for (lce = (list_classpath_entry*) list_first(list_classpath_entries); lce != NULL;
                 lce = (list_classpath_entry*) list_next(list_classpath_entries, lce)) {
                if (lce->type == CLASSPATH_ARCHIVE)
-                       LOCK_INIT_OBJECT_LOCK(lce);
+                       lce->mutex = new Mutex();
        }
 #endif
 
index 38d7ddeff801de8601620bf997bfbb54f82e056c..e6cefe1b3a28d6dcd85b0208277d4c4e737f5db2 100644 (file)
@@ -34,7 +34,7 @@
 
 #include "mm/memory.h"
 
-#include "threads/lock-common.h"
+#include "threads/mutex.hpp"
 
 #include "toolbox/list.h"
 #include "toolbox/logging.h"
@@ -535,7 +535,7 @@ classbuffer *suck_start(classinfo *c)
 
                        /* enter a monitor on zip/jar archives */
 
-                       LOCK_MONITOR_ENTER(lce);
+                       Mutex_lock(lce->mutex);
 
                        /* try to get the file in current archive */
 
@@ -543,7 +543,7 @@ classbuffer *suck_start(classinfo *c)
 
                        /* leave the monitor */
 
-                       LOCK_MONITOR_EXIT(lce);
+                       Mutex_unlock(lce->mutex);
 
                } else {
 #endif /* defined(ENABLE_ZLIB) */
index bc5e7188a74d9b7f4361c2581f6d83e3c9678e09..20a18ee0c5f526325c501b7ed28622b96d890b80 100644 (file)
@@ -34,6 +34,8 @@ extern "C" {
 
 #include "vm/types.h"
 
+#include "threads/mutex.hpp"
+
 #include "toolbox/hashtable.h"
 #include "toolbox/list.h"
 
@@ -53,7 +55,7 @@ typedef struct list_classpath_entry list_classpath_entry;
 
 struct list_classpath_entry {
 #if defined(ENABLE_THREADS)
-       java_object_t      header;              /* monitor locking on zip/jar files   */
+       Mutex             *mutex;               /* mutex locking on zip/jar files */
 #endif
        s4                 type;
        char              *path;