From ada5cb065047a8d64180b60259d51175df805b47 Mon Sep 17 00:00:00 2001 From: stefan Date: Sat, 13 Dec 2003 18:19:19 +0000 Subject: [PATCH] Native threads --- global.h | 12 +++++++++++- src/threads/green/threads.c | 4 ++++ src/vm/global.h | 12 +++++++++++- threads/thread.c | 4 ++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/global.h b/global.h index ad56924e6..d223eb779 100644 --- a/global.h +++ b/global.h @@ -31,7 +31,7 @@ Philipp Tomsich Edwin Steiner - $Id: global.h 727 2003-12-11 10:52:40Z edwin $ + $Id: global.h 737 2003-12-13 18:19:19Z stefan $ */ @@ -43,6 +43,10 @@ #include "types.h" #include "toolbox/list.h" +#if defined(USE_THREADS) && defined(NATIVE_THREADS) +#include +#endif + #define _GNU_SOURCE @@ -850,6 +854,12 @@ extern primitivetypeinfo primitivetype_table[PRIMITIVETYPE_COUNT]; if ((utf_ptr)[-1] != ';') \ (errorflag) = true; }} while(0) + +/* Synchronization ************************************************************/ + +extern pthread_mutex_t cast_mutex; +extern pthread_mutex_t compiler_mutex; + #endif /* _GLOBAL_H */ diff --git a/src/threads/green/threads.c b/src/threads/green/threads.c index fc9815e22..4d39c5de5 100644 --- a/src/threads/green/threads.c +++ b/src/threads/green/threads.c @@ -32,6 +32,10 @@ #include "toolbox/loging.h" #include "toolbox/memory.h" +#if defined(NATIVE_THREADS) +pthread_mutex_t cast_mutex = PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t compiler_mutex = PTHREAD_MUTEX_INITIALIZER; +#endif static classinfo *class_java_lang_ThreadDeath; diff --git a/src/vm/global.h b/src/vm/global.h index ad56924e6..d223eb779 100644 --- a/src/vm/global.h +++ b/src/vm/global.h @@ -31,7 +31,7 @@ Philipp Tomsich Edwin Steiner - $Id: global.h 727 2003-12-11 10:52:40Z edwin $ + $Id: global.h 737 2003-12-13 18:19:19Z stefan $ */ @@ -43,6 +43,10 @@ #include "types.h" #include "toolbox/list.h" +#if defined(USE_THREADS) && defined(NATIVE_THREADS) +#include +#endif + #define _GNU_SOURCE @@ -850,6 +854,12 @@ extern primitivetypeinfo primitivetype_table[PRIMITIVETYPE_COUNT]; if ((utf_ptr)[-1] != ';') \ (errorflag) = true; }} while(0) + +/* Synchronization ************************************************************/ + +extern pthread_mutex_t cast_mutex; +extern pthread_mutex_t compiler_mutex; + #endif /* _GLOBAL_H */ diff --git a/threads/thread.c b/threads/thread.c index fc9815e22..4d39c5de5 100644 --- a/threads/thread.c +++ b/threads/thread.c @@ -32,6 +32,10 @@ #include "toolbox/loging.h" #include "toolbox/memory.h" +#if defined(NATIVE_THREADS) +pthread_mutex_t cast_mutex = PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t compiler_mutex = PTHREAD_MUTEX_INITIALIZER; +#endif static classinfo *class_java_lang_ThreadDeath; -- 2.25.1