43 struct JavaVMAttachArgs;
83 #if defined(ENABLE_THREADS)
132 #if defined(ENABLE_INTRP)
136 #if defined(ENABLE_GC_CACAO)
145 #if defined(ENABLE_DEBUG_FILTER)
154 #if defined(ENABLE_TLH)
158 #if defined(ENABLE_ESCAPE_REASON)
159 void *escape_reasons;
166 # define DEBUGTHREADS(message, thread) \
168 if (opt_DebugThreads) { \
169 printf("[Thread %-16s: ", message); \
170 thread_print_info(thread); \
175 # define DEBUGTHREADS(message, thread)
181 #if defined(__LINUX__)
183 extern bool threads_pthreads_implementation_nptl;
190 # define TRACEJAVACALLINDENT (THREADOBJECT->tracejavacallindent)
191 # define TRACEJAVACALLCOUNT (THREADOBJECT->tracejavacallcount)
197 #if defined(ENABLE_DEBUG_FILTER)
198 # define FILTERVERBOSECALLCTR (THREADOBJECT->filterverbosecallctr)
204 #if defined(ENABLE_GC_CACAO)
205 # define THREAD_NATIVEWORLD_ENTER THREADOBJECT->flags |= THREAD_FLAG_IN_NATIVE
206 # define THREAD_NATIVEWORLD_EXIT THREADOBJECT->flags &= ~THREAD_FLAG_IN_NATIVE
208 # define THREAD_NATIVEWORLD_ENTER
209 # define THREAD_NATIVEWORLD_EXIT
217 #if defined(ENABLE_THREADS)
378 #if defined(ENABLE_TLH)
379 void threads_tlh_add_frame();
380 void threads_tlh_remove_frame();
388 #if defined(ENABLE_GC_CACAO)
389 void threads_mutex_gc_lock(
void);
390 void threads_mutex_gc_unlock(
void);
405 #endif // THREAD_HPP_
void threads_start_thread(threadobject *thread, functionptr function)
bool thread_detach_current_external_thread(void)
Detaches the current external thread from the VM.
void threads_thread_interrupt(threadobject *t)
bool threads_suspend_thread(threadobject *thread, SuspendReason reason)
Suspend the passed thread.
void threads_preinit(void)
static struct stackframeinfo_t * threads_get_current_stackframeinfo(void)
void threads_unpark(threadobject *t)
Unpark the specified thread.
intptr_t threads_get_tid(threadobject *t)
bool thread_attach_current_thread(JavaVMAttachArgs *vm_aargs, bool isdaemon)
Attaches the current thread to the VM.
void thread_set_state_runnable(threadobject *t)
static java_handle_t * thread_get_current_object(void)
struct threadobject * flc_list
void thread_set_state_timed_parked(threadobject *t)
bool threads_thread_start_internal(Utf8String name, functionptr f)
bool thread_handle_is_interrupted(java_handle_t *th)
static bool thread_is_daemon(threadobject *t)
static int cacaothread_get_state(threadobject *t)
int thread_handle_get_state(java_handle_t *th)
Dummy implementation of a mutex.
void threads_impl_thread_clear(threadobject *t)
struct threadobject * flc_next
JNIEnv jclass jobject const char * name
void threads_set_thread_priority(threadobject *t, int priority)
static bool thread_current_is_attached(void)
void(* functionptr)(void)
cacao::detail::threadobject impl
void threads_thread_start(java_handle_t *object)
java_object_t * _exceptionptr
void thread_set_state_parked(threadobject *t)
intptr_t threads_get_current_tid(void)
void threads_impl_thread_start(threadobject *thread, functionptr f)
localref_table * _localref_table
bool thread_attach_current_external_thread(JavaVMAttachArgs *vm_aargs, bool isdaemon)
Attaches the current external thread to the VM.
void threads_wait_with_timeout_relative(threadobject *thread, s8 millis, s4 nanos)
SuspendReason suspend_reason
void thread_fprint_name(threadobject *t, FILE *stream)
bool thread_is_interrupted(threadobject *t)
void thread_free(threadobject *t)
Dummy condition variable.
void threads_join_all_threads()
struct threadobject * flc_tail
void threads_suspend_ack()
static threadobject * thread_get_current(void)
void thread_set_state_terminated(threadobject *t)
void thread_handle_set_priority(java_handle_t *th, int priority)
bool thread_detach_current_thread(void)
Detaches the current thread from the VM.
threadobject * thread_get_thread(java_handle_t *h)
java_handle_t * flc_object
bool threads_thread_is_alive(threadobject *t)
void threads_impl_preinit()
void thread_set_interrupted(threadobject *t, bool interrupted)
u2 filterverbosecallctr[2]
static bool thread_is_attached(threadobject *t)
void thread_set_state_timed_waiting(threadobject *t)
void threads_park(bool absolute, int64_t nanos)
Park the current thread for the specified amount of time or until a specified deadline.
void threads_impl_clear_heap_pointers(threadobject *t)
void thread_print_info(threadobject *t)
void thread_set_state_waiting(threadobject *t)
stackframeinfo_t * _stackframeinfo
void threads_sleep(int64_t millis, int32_t nanos)
DumpMemory * _dumpmemory
Dump memory structure.
Thread-local dump memory structure.
void threads_impl_thread_reuse(threadobject *t)
static void threads_set_current_stackframeinfo(struct stackframeinfo_t *sfi)
void thread_handle_interrupt(java_handle_t *th)
bool threads_resume_thread(threadobject *thread, SuspendReason reason)
Resumes execution of the passed thread.