#include "arch.h"
-#if !defined(USE_FAKE_ATOMIC_INSTRUCTIONS)
-# include "machine-instr.h"
-#else
-# include "threads/posix/generic-primitives.h"
-#endif
-
#include "mm/gc-common.h"
#include "mm/memory.h"
static sem_t suspend_ack;
#endif
-/* mutexes used by the fake atomic instructions */
-#if defined(USE_FAKE_ATOMIC_INSTRUCTIONS)
-mutex_t _cas_lock = MUTEX_INITIALIZER;
-mutex_t _mb_lock = MUTEX_INITIALIZER;
-#endif
-
/* threads_sem_init ************************************************************
t->suspendmutex = Mutex_new();
t->suspendcond = Condition_new();
+
+#if defined(ENABLE_TLH)
+ tlh_init(&(t->tlh));
+#endif
}
/* threads_impl_thread_clear ***************************************************
/* not really needed */
t->flc_object = NULL;
+
+#if defined(ENABLE_TLH)
+ tlh_destroy(&(t->tlh));
+ tlh_init(&(t->tlh));
+#endif
}
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.