void threads_impl_thread_init(threadobject *t)
{
- int result;
-
/* initialize the mutex and the condition */
- mutex_init(&t->flc_lock);
+ t->flc_lock = Mutex_new();
+ t->flc_cond = Condition_new();
- result = pthread_cond_init(&t->flc_cond, NULL);
- if (result != 0)
- vm_abort_errnum(result, "threads_impl_thread_new: pthread_cond_init failed");
-
- mutex_init(&(t->waitmutex));
-
- result = pthread_cond_init(&(t->waitcond), NULL);
- if (result != 0)
- vm_abort_errnum(result, "threads_impl_thread_new: pthread_cond_init failed");
-
- mutex_init(&(t->suspendmutex));
+ t->waitmutex = Mutex_new();
+ t->waitcond = Condition_new();
- result = pthread_cond_init(&(t->suspendcond), NULL);
- if (result != 0)
- vm_abort_errnum(result, "threads_impl_thread_new: pthread_cond_init failed");
+ t->suspendmutex = Mutex_new();
+ t->suspendcond = Condition_new();
+
+#if defined(ENABLE_TLH)
+ tlh_init(&(t->tlh));
+#endif
}
/* threads_impl_thread_clear ***************************************************
#include "mm/memory.h"
+#if defined(ENABLE_TLH)
+#include "mm/tlh.h"
+#endif
+
#include "native/localref.h"
- #include "threads/mutex.h"
+ #include "threads/condition.hpp"
+ #include "threads/mutex.hpp"
#include "threads/posix/lock.h"