* src/vm/jit/show.c (show_global_lock): Renamed to mutex and changed
authorChristian Thalinger <twisti@complang.tuwien.ac.at>
Fri, 8 Aug 2008 17:55:18 +0000 (19:55 +0200)
committerChristian Thalinger <twisti@complang.tuwien.ac.at>
Fri, 8 Aug 2008 17:55:18 +0000 (19:55 +0200)
type to Mutex.
(show_init): Initialize mutex.
(show_method): Use mutex.

src/vm/jit/show.c

index 2e658089e19fdc7e87571c6eaf073367fa8da5f4..55e3592c1f13d68bd2ecec751725f6ca36124184 100644 (file)
@@ -56,8 +56,8 @@
 
 /* global variables ***********************************************************/
 
-#if defined(ENABLE_THREADS) && !defined(NDEBUG)
-static java_object_t *show_global_lock;
+#if !defined(NDEBUG)
+static Mutex* mutex;
 #endif
 
 
@@ -80,9 +80,7 @@ bool show_init(void)
 #if defined(ENABLE_THREADS)
        /* initialize the show lock */
 
-       show_global_lock = NEW(java_object_t);
-
-       LOCK_INIT_OBJECT_LOCK(show_global_lock);
+       mutex = Mutex_new();
 #endif
 
 #if defined(ENABLE_DEBUG_FILTER)
@@ -157,7 +155,7 @@ void show_method(jitdata *jd, int stage)
           is not reentrant-able and we could not read functions printed
           at the same time. */
 
-       LOCK_MONITOR_ENTER(show_global_lock);
+       Mutex_lock(mutex);
 
 #if defined(ENABLE_INTRP)
        if (opt_intrp)
@@ -388,7 +386,7 @@ void show_method(jitdata *jd, int stage)
        }
 #endif
 
-       LOCK_MONITOR_EXIT(show_global_lock);
+       Mutex_unlock(mutex);
 
        /* finally flush the output */