#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"
#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))
struct threadobject *flc_list; /* FLC list head for this thread */
struct threadobject *flc_next; /* next pointer for FLC list */
java_handle_t *flc_object;
- mutex_t flc_lock; /* controlling access to these fields */
- pthread_cond_t flc_cond;
+ Mutex* flc_lock; /* controlling access to these fields */
+ Condition* flc_cond;
/* these are used for the wait/notify implementation */
- mutex_t waitmutex;
- pthread_cond_t waitcond;
+ Mutex* waitmutex;
+ Condition* waitcond;
- mutex_t suspendmutex; /* lock before suspending this thread */
- pthread_cond_t suspendcond; /* notify to resume this thread */
+ Mutex* suspendmutex; /* lock before suspending this thread */
+ Condition* suspendcond; /* notify to resume this thread */
bool interrupted;
bool signaled;
- bool sleeping;
bool suspended; /* is this thread suspended? */
s4 suspend_reason; /* reason for suspending */
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 */
};
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_thread_interrupt(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 /* _THREAD_POSIX_H */