From 5992773cad339da5011f9b6649306707188a6df8 Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Fri, 22 Aug 2008 11:48:01 +0200 Subject: [PATCH] * src/threads/posix/thread-posix.cpp (threads_impl_thread_init): Removed. * src/threads/thread.cpp (thread_new): Moved code from threads_impl_thread_init. * src/threads/thread.hpp (threads_impl_thread_init): Removed. --- src/threads/posix/thread-posix.cpp | 27 --------------------------- src/threads/thread.cpp | 18 ++++++++++++++---- src/threads/thread.hpp | 1 - 3 files changed, 14 insertions(+), 32 deletions(-) diff --git a/src/threads/posix/thread-posix.cpp b/src/threads/posix/thread-posix.cpp index 34a62958e..eb62ce6a9 100644 --- a/src/threads/posix/thread-posix.cpp +++ b/src/threads/posix/thread-posix.cpp @@ -432,33 +432,6 @@ void threads_startworld(void) #endif -/* threads_impl_thread_init **************************************************** - - Initialize OS-level locking constructs in threadobject. - - IN: - t....the threadobject - -*******************************************************************************/ - -void threads_impl_thread_init(threadobject *t) -{ - /* initialize the mutex and the condition */ - - t->flc_lock = new Mutex(); - t->flc_cond = new Condition(); - - t->waitmutex = new Mutex(); - t->waitcond = new Condition(); - - t->suspendmutex = new Mutex(); - t->suspendcond = new Condition(); - -#if defined(ENABLE_TLH) - tlh_init(&(t->tlh)); -#endif -} - /* threads_impl_thread_clear *************************************************** Clears all fields in threadobject the way an MZERO would have diff --git a/src/threads/thread.cpp b/src/threads/thread.cpp index 195ac6fa8..0b7e0c472 100644 --- a/src/threads/thread.cpp +++ b/src/threads/thread.cpp @@ -485,6 +485,20 @@ static threadobject *thread_new(void) MZERO(t, threadobject, 1); + // Initialize the mutex and the condition. + t->flc_lock = new Mutex(); + t->flc_cond = new Condition(); + + t->waitmutex = new Mutex(); + t->waitcond = new Condition(); + + t->suspendmutex = new Mutex(); + t->suspendcond = new Condition(); + +#if defined(ENABLE_TLH) + tlh_init(&(t->tlh)); +#endif + #if defined(ENABLE_GC_CACAO) /* Register reference to java.lang.Thread with the GC. */ /* FIXME is it ok to do this only once? */ @@ -492,10 +506,6 @@ static threadobject *thread_new(void) gc_reference_register(&(t->object), GC_REFTYPE_THREADOBJECT); gc_reference_register(&(t->_exceptionptr), GC_REFTYPE_THREADOBJECT); #endif - - /* Initialize the implementation-specific bits. */ - - threads_impl_thread_init(t); } /* Pre-compute the thinlock-word. */ diff --git a/src/threads/thread.hpp b/src/threads/thread.hpp index ba5ff0a9e..463cd370a 100644 --- a/src/threads/thread.hpp +++ b/src/threads/thread.hpp @@ -348,7 +348,6 @@ void threads_mutex_gc_unlock(void); void threads_mutex_join_lock(void); void threads_mutex_join_unlock(void); -void threads_impl_thread_init(threadobject *t); void threads_impl_thread_clear(threadobject *t); void threads_impl_thread_reuse(threadobject *t); void threads_impl_thread_free(threadobject *t); -- 2.25.1