CACAO
Functions | Variables
thread.cpp File Reference

Go to the source code of this file.

Functions

static void thread_create_initial_thread (void)
 
static threadobjectthread_new (int32_t flags)
 
void threads_preinit (void)
 
void threads_init (void)
 
static bool thread_create_object (threadobject *t, java_handle_t *name, java_handle_t *group)
 
void thread_free (threadobject *t)
 
static void thread_cleanup_finalizer (java_handle_t *h, void *data)
 
bool threads_thread_start_internal (Utf8String name, functionptr f)
 
void threads_thread_start (java_handle_t *object)
 
bool thread_attach_current_thread (JavaVMAttachArgs *vm_aargs, bool isdaemon)
 Attaches the current thread to the VM. More...
 
bool thread_attach_current_external_thread (JavaVMAttachArgs *vm_aargs, bool isdaemon)
 Attaches the current external thread to the VM. More...
 
bool thread_detach_current_external_thread (void)
 Detaches the current external thread from the VM. More...
 
void thread_fprint_name (threadobject *t, FILE *stream)
 
void thread_print_info (threadobject *t)
 
intptr_t threads_get_current_tid (void)
 
static void thread_set_state (threadobject *t, ThreadState state)
 Set the current state of the given thread. More...
 
void thread_set_state_runnable (threadobject *t)
 
void thread_set_state_waiting (threadobject *t)
 
void thread_set_state_timed_waiting (threadobject *t)
 
void thread_set_state_parked (threadobject *t)
 
void thread_set_state_timed_parked (threadobject *t)
 
void thread_set_state_terminated (threadobject *t)
 
threadobjectthread_get_thread (java_handle_t *h)
 
bool threads_thread_is_alive (threadobject *t)
 
bool thread_is_interrupted (threadobject *t)
 
void thread_set_interrupted (threadobject *t, bool interrupted)
 
void thread_handle_set_priority (java_handle_t *th, int priority)
 
bool thread_handle_is_interrupted (java_handle_t *th)
 
void thread_handle_interrupt (java_handle_t *th)
 
int thread_handle_get_state (java_handle_t *th)
 

Variables

static methodinfothread_method_init
 
static java_handle_tthreadgroup_system
 
static java_handle_tthreadgroup_main
 

Function Documentation

bool thread_attach_current_external_thread ( JavaVMAttachArgs *  vm_aargs,
bool  isdaemon 
)

Attaches the current external thread to the VM.

This function is called by JNI's AttachCurrentThread.

Parameters
vm_aargsAttach arguments.
isdaemontrue if the attached thread should be a daemon thread.
Returns
true on success, false otherwise.

Definition at line 584 of file thread.cpp.

bool thread_attach_current_thread ( JavaVMAttachArgs *  vm_aargs,
bool  isdaemon 
)

Attaches the current thread to the VM.

Parameters
vm_aargsAttach arguments.
isdaemontrue if the attached thread should be a daemon thread.
Returns
true on success, false otherwise.

Definition at line 495 of file thread.cpp.

static void thread_cleanup_finalizer ( java_handle_t h,
void data 
)
static

Definition at line 396 of file thread.cpp.

static void thread_create_initial_thread ( void  )
static

Definition at line 223 of file thread.cpp.

static bool thread_create_object ( threadobject t,
java_handle_t name,
java_handle_t group 
)
static

Definition at line 198 of file thread.cpp.

bool thread_detach_current_external_thread ( void  )

Detaches the current external thread from the VM.

This function is called by JNI's DetachCurrentThread.

Returns
true on success, false otherwise.

Definition at line 603 of file thread.cpp.

void thread_fprint_name ( threadobject t,
FILE *  stream 
)

Definition at line 630 of file thread.cpp.

void thread_free ( threadobject t)

Definition at line 371 of file thread.cpp.

threadobject* thread_get_thread ( java_handle_t h)

Definition at line 874 of file thread.cpp.

int thread_handle_get_state ( java_handle_t th)

Definition at line 1012 of file thread.cpp.

void thread_handle_interrupt ( java_handle_t th)

Definition at line 995 of file thread.cpp.

bool thread_handle_is_interrupted ( java_handle_t th)

Definition at line 981 of file thread.cpp.

void thread_handle_set_priority ( java_handle_t th,
int  priority 
)

Definition at line 964 of file thread.cpp.

bool thread_is_interrupted ( threadobject t)

Definition at line 926 of file thread.cpp.

static threadobject * thread_new ( int32_t  flags)
static

Definition at line 266 of file thread.cpp.

void thread_print_info ( threadobject t)

Definition at line 650 of file thread.cpp.

void thread_set_interrupted ( threadobject t,
bool  interrupted 
)

Definition at line 949 of file thread.cpp.

static void thread_set_state ( threadobject t,
ThreadState  state 
)
inlinestatic

Set the current state of the given thread.

This method should only be called while holding the threadlist-lock and after checking that the new state is valid. It is best to not call this method directly but call the specific setter methods below.

Definition at line 736 of file thread.cpp.

void thread_set_state_parked ( threadobject t)

Definition at line 812 of file thread.cpp.

void thread_set_state_runnable ( threadobject t)

Definition at line 754 of file thread.cpp.

void thread_set_state_terminated ( threadobject t)

Definition at line 848 of file thread.cpp.

void thread_set_state_timed_parked ( threadobject t)

Definition at line 831 of file thread.cpp.

void thread_set_state_timed_waiting ( threadobject t)

Definition at line 793 of file thread.cpp.

void thread_set_state_waiting ( threadobject t)

Definition at line 773 of file thread.cpp.

intptr_t threads_get_current_tid ( void  )

Definition at line 722 of file thread.cpp.

void threads_init ( void  )

Definition at line 164 of file thread.cpp.

void threads_preinit ( void  )

Definition at line 84 of file thread.cpp.

bool threads_thread_is_alive ( threadobject t)

Definition at line 886 of file thread.cpp.

void threads_thread_start ( java_handle_t object)

Definition at line 445 of file thread.cpp.

bool threads_thread_start_internal ( Utf8String  name,
functionptr  f 
)

Definition at line 402 of file thread.cpp.

Variable Documentation

methodinfo* thread_method_init
static

Definition at line 62 of file thread.cpp.

java_handle_t* threadgroup_main
static

Definition at line 64 of file thread.cpp.

java_handle_t* threadgroup_system
static

Definition at line 63 of file thread.cpp.