* src/mm/tlh.c (tlh_alloc): Correctly zero memory.
[cacao.git] / src / threads / posix / thread-posix.h
index a3602c8a4e31620d5a3d210b851a0afb34e91694..349b5c33248f26e231778bd6d947db17615b7b63 100644 (file)
@@ -23,8 +23,8 @@
 */
 
 
-#ifndef _THREADS_H
-#define _THREADS_H
+#ifndef _THREAD_POSIX_H
+#define _THREAD_POSIX_H
 
 /* forward typedefs ***********************************************************/
 
@@ -40,6 +40,10 @@ typedef struct threadobject threadobject;
 
 #include "mm/memory.h"
 
+#if defined(ENABLE_TLH)
+#include "mm/tlh.h"
+#endif
+
 #include "native/localref.h"
 
 #include "threads/mutex.h"
@@ -73,18 +77,17 @@ typedef struct {
 #endif
 
 
+
 /* current threadobject *******************************************************/
 
 #if defined(HAVE___THREAD)
 
-#define THREADSPECIFIC    __thread
 #define THREADOBJECT      thread_current
 
 extern __thread threadobject *thread_current;
 
 #else /* defined(HAVE___THREAD) */
 
-#define THREADSPECIFIC
 #define THREADOBJECT \
        ((threadobject *) pthread_getspecific(thread_current_key))
 
@@ -173,6 +176,14 @@ struct threadobject {
        u4                    tracejavacallcount;
 #endif
 
+#if defined(ENABLE_TLH)
+       tlh_t                 tlh;
+#endif
+
+#if defined(ENABLE_ESCAPE_REASON)
+       void *escape_reasons;
+#endif
+
        listnode_t            linkage;      /* threads-list                       */
        listnode_t            linkage_free; /* free-list                          */
 };
@@ -275,26 +286,26 @@ void threads_set_thread_priority(pthread_t tid, int priority);
 
 bool threads_detach_thread(threadobject *thread);
 
+#if defined(ENABLE_GC_CACAO)
 bool threads_suspend_thread(threadobject *thread, s4 reason);
 void threads_suspend_ack(u1* pc, u1* sp);
 bool threads_resume_thread(threadobject *thread);
+#endif
 
 void threads_join_all_threads(void);
 
-void threads_sleep(s8 millis, s4 nanos);
+void threads_sleep(int64_t millis, int32_t nanos);
 
 void threads_wait_with_timeout_relative(threadobject *t, s8 millis, s4 nanos);
 
 void threads_thread_interrupt(threadobject *thread);
-bool threads_check_if_interrupted_and_reset(void);
-bool threads_thread_has_been_interrupted(threadobject *thread);
 
-#if !defined(DISABLE_GC)
-void threads_stopworld(void);
-void threads_startworld(void);
+#if defined(ENABLE_TLH)
+void threads_tlh_add_frame();
+void threads_tlh_remove_frame();
 #endif
 
-#endif /* _THREADS_H */
+#endif /* _THREAD_POSIX_H */
 
 
 /*