aboutsummaryrefslogtreecommitdiff
path: root/libjava/interpret.cc
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2008-09-23 13:51:58 +0000
committerAndrew Haley <aph@gcc.gnu.org>2008-09-23 13:51:58 +0000
commitf0580031a7919f8e1401db1c2e6515e1682eaaa7 (patch)
tree5aa7ac0da62ededbaab14350de950b012a5759a3 /libjava/interpret.cc
parent5c0466b537af28f3cf7aff8d29c884a3c5725459 (diff)
downloadgcc-f0580031a7919f8e1401db1c2e6515e1682eaaa7.zip
gcc-f0580031a7919f8e1401db1c2e6515e1682eaaa7.tar.gz
gcc-f0580031a7919f8e1401db1c2e6515e1682eaaa7.tar.bz2
re PR libgcj/8995 (race cases in interpreter)
2008-09-17 Andrew Haley <aph@redhat.com> PR libgcj/8995: * defineclass.cc (_Jv_ClassReader::handleCodeAttribute): Initialize thread_count. * include/java-interp.h (_Jv_InterpMethod::thread_count): New field. (_Jv_InterpMethod::rewrite_insn_mutex): New mutex. (_Jv_InterpFrame:: _Jv_InterpFrame): Pass frame_type. * interpret.cc (ThreadCountAdjuster): New class. (_Jv_InterpMethod::thread_count): New field. (_Jv_InitInterpreter): Initialize rewrite_insn_mutex. Increment and decrement thread_count field in methods. * interpret-run.cc (REWRITE_INSN): Check thread_count <= 1. (REWRITE_INSN): Likewise. Declare a ThreadCountAdjuster. * java/lang/reflect/natVMProxy.cc (run_proxy): Initialize frame type as frame_proxy. From-SVN: r140593
Diffstat (limited to 'libjava/interpret.cc')
-rw-r--r--libjava/interpret.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/libjava/interpret.cc b/libjava/interpret.cc
index 6153c54..dc1114f 100644
--- a/libjava/interpret.cc
+++ b/libjava/interpret.cc
@@ -78,10 +78,15 @@ static void find_catch_location (jthrowable, jthread, jmethodID *, jlong *);
// the Class monitor as user code in another thread could hold it.
static _Jv_Mutex_t compile_mutex;
+// See class ThreadCountAdjuster and REWRITE_INSN for how this is
+// used.
+_Jv_Mutex_t _Jv_InterpMethod::rewrite_insn_mutex;
+
void
_Jv_InitInterpreter()
{
_Jv_MutexInit (&compile_mutex);
+ _Jv_MutexInit (&_Jv_InterpMethod::rewrite_insn_mutex);
}
#else
void _Jv_InitInterpreter() {}