X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fthreads%2Fposix%2Fthread-posix.h;h=bb8b4206d9efdf30553678d0d6785b34d0e58e1e;hb=7659949229c634784f7d27aa8b679fdd4c8351ab;hp=99e6cb092470d944f8afcb8b416f94e5855ba6bf;hpb=b76e356b0af200d2568e6fc55e82e233f1808eb9;p=cacao.git diff --git a/src/threads/posix/thread-posix.h b/src/threads/posix/thread-posix.h index 99e6cb092..bb8b4206d 100644 --- a/src/threads/posix/thread-posix.h +++ b/src/threads/posix/thread-posix.h @@ -40,9 +40,14 @@ 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" +#include "threads/condition.hpp" +#include "threads/mutex.hpp" #include "threads/posix/lock.h" @@ -73,18 +78,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)) @@ -128,19 +132,18 @@ struct threadobject { 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 */ @@ -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 */ }; @@ -273,11 +284,11 @@ void threads_start_thread(threadobject *thread, functionptr function); 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); @@ -287,9 +298,9 @@ void threads_wait_with_timeout_relative(threadobject *t, s8 millis, s4 nanos); 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 */