* src/cacaoh/dummy.c (compiler_lock, compiler_unlock): Removed.
* src/threads/native/threads.c (compiler_lock, compiler_unlock): Removed.
* src/vmcore/linker.h (linker_classrenumber_lock): Added.
* src/vmcore/linker.c (linker_classrenumber_lock): Added.
(linker_compute_subclasses): Uses above lock object instead of compiler_lock.
* src/vm/jit/intrp/asmpart.c (intrp_asm_getclassvalues_atomic): Likewise.
char *_Jv_bootclasspath;
-void compiler_lock()
-{
-}
-
-void compiler_unlock()
-{
-}
-
java_objectheader *javastring_new_slash_to_dot(utf *u)
{
vm_abort("javastring_new_slash_to_dot");
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: threads.c 7669 2007-04-05 11:39:58Z twisti $
+ $Id: threads.c 7675 2007-04-05 14:23:04Z michi $
*/
/* global threads table */
static threads_table_t threads_table;
-/* global compiler mutex */
-static pthread_mutex_t compiler_mutex;
-
/* global mutex for changing the thread list */
static pthread_mutex_t threadlistlock;
}
-/* compiler_lock ***************************************************************
-
- Enter the compiler lock.
-
-******************************************************************************/
-
-void compiler_lock(void)
-{
- pthread_mutex_lock(&compiler_mutex);
-}
-
-
-/* compiler_unlock *************************************************************
-
- Release the compiler lock.
-
-******************************************************************************/
-
-void compiler_unlock(void)
-{
- pthread_mutex_unlock(&compiler_mutex);
-}
-
-
/* lock_stopworld **************************************************************
Enter the stopworld lock, specifying why the world shall be stopped.
void threads_preinit(void)
{
- pthread_mutexattr_t mutexattr;
- pthread_mutexattr_init(&mutexattr);
- pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&compiler_mutex, &mutexattr);
- pthread_mutexattr_destroy(&mutexattr);
-
pthread_mutex_init(&threadlistlock, NULL);
pthread_mutex_init(&stopworldlock, NULL);
Joseph Wenninger
Christian Thalinger
- $Id: global.h 7561 2007-03-23 19:10:35Z twisti $
+ $Id: global.h 7675 2007-04-05 14:23:04Z michi $
*/
};
-/* Synchronization ************************************************************/
-
-#if defined(ENABLE_THREADS)
-void compiler_lock();
-void compiler_unlock();
-#endif
-
-
/* global constants related to the verifier ***********************************/
/* The verifier needs additional variables in the variable array. Since these */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: asmpart.c 7357 2007-02-14 11:35:59Z twisti $
+ $Id: asmpart.c 7675 2007-04-05 14:23:04Z michi $
*/
#include "vm/jit/dseg.h"
#include "vmcore/class.h"
+#include "vmcore/linker.h"
#include "vmcore/loader.h"
#include "vmcore/options.h"
{
s4 sbv, sdv, sv;
-#if defined(ENABLE_THREADS)
- compiler_lock();
-#endif
+ LOCK_MONITOR_ENTER(linker_classrenumber_lock);
sbv = super->baseval;
sdv = super->diffval;
sv = sub->baseval;
-#if defined(ENABLE_THREADS)
- compiler_unlock();
-#endif
+ LOCK_MONITOR_EXIT(linker_classrenumber_lock);
out->super_baseval = sbv;
out->super_diffval = sdv;
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: linker.c 7561 2007-03-23 19:10:35Z twisti $
+ $Id: linker.c 7675 2007-04-05 14:23:04Z michi $
*/
static s4 interfaceindex; /* sequential numbering of interfaces */
static s4 classvalue;
+java_objectheader *linker_classrenumber_lock;
+
/* primitivetype_table *********************************************************
interfaceindex = 0;
+ /* create the global lock object */
+
+ linker_classrenumber_lock = NEW(java_objectheader);
+
/* link java.lang.Class as first class of the system, because we
need it's vftbl for all other classes so we can use a class as
object */
static void linker_compute_subclasses(classinfo *c)
{
-#if defined(ENABLE_THREADS)
- compiler_lock();
-#endif
+ LOCK_MONITOR_ENTER(linker_classrenumber_lock);
if (!(c->flags & ACC_INTERFACE)) {
c->nextsub = NULL;
linker_compute_class_values(class_java_lang_Object);
-#if defined(ENABLE_THREADS)
- compiler_unlock();
-#endif
+ LOCK_MONITOR_EXIT(linker_classrenumber_lock);
}
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: linker.h 7246 2007-01-29 18:49:05Z twisti $
+ $Id: linker.h 7675 2007-04-05 14:23:04Z michi $
*/
extern primitivetypeinfo primitivetype_table[PRIMITIVETYPE_COUNT];
+/* This lock must be taken while renumbering classes or while atomically */
+/* accessing classes. */
+
+extern java_objectheader *linker_classrenumber_lock;
+
/* function prototypes ********************************************************/