Merged with tip.
[cacao.git] / src / threads / posix / thread-posix.c
index bfcdc58a7c37ac9a54196457e05b455b117897e6..defe4220e711761f2d8aad96266ddc0c50bd6428 100644 (file)
@@ -475,6 +475,10 @@ void threads_impl_thread_init(threadobject *t)
 
        t->suspendmutex = Mutex_new();
        t->suspendcond = Condition_new();
+
+#if defined(ENABLE_TLH)
+       tlh_init(&(t->tlh));
+#endif
 }
 
 /* threads_impl_thread_clear ***************************************************
@@ -563,6 +567,11 @@ void threads_impl_thread_reuse(threadobject *t)
 
 /*     not really needed */
        t->flc_object = NULL;
+
+#if defined(ENABLE_TLH)
+       tlh_destroy(&(t->tlh));
+       tlh_init(&(t->tlh));
+#endif
 }
 
 
@@ -1617,6 +1626,17 @@ void threads_yield(void)
        sched_yield();
 }
 
+#if defined(ENABLE_TLH)
+
+void threads_tlh_add_frame() {
+       tlh_add_frame(&(THREADOBJECT->tlh));
+}
+
+void threads_tlh_remove_frame() {
+       tlh_remove_frame(&(THREADOBJECT->tlh));
+}
+
+#endif
 
 /*
  * These are local overrides for various environment variables in Emacs.