* src/threads/posix/thread-posix.cpp (threads_impl_thread_init):
authorChristian Thalinger <twisti@complang.tuwien.ac.at>
Fri, 22 Aug 2008 09:48:01 +0000 (11:48 +0200)
committerChristian Thalinger <twisti@complang.tuwien.ac.at>
Fri, 22 Aug 2008 09:48:01 +0000 (11:48 +0200)
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
src/threads/thread.cpp
src/threads/thread.hpp

index 34a62958e10f1fab952bd307e755bd0b0ba6ba6b..eb62ce6a91b4378555768ddf993e8d6888ec8bbb 100644 (file)
@@ -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
index 195ac6fa844926e05c6d50f714ef15a1295f9b0c..0b7e0c472209ce2c75643184e01a6fabb798d260 100644 (file)
@@ -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. */
index ba5ff0a9e2955422bc1194358ac94f5100cad075..463cd370a0075458e1a03cb904e314ee8ec68d7a 100644 (file)
@@ -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);