/* set the threads-index */
t->index = list_threads->size + 1;
+
+#if defined(ENABLE_GC_CACAO)
+ /* register reference to java.lang.Thread with the GC */
+
+ gc_reference_register((java_object_t **) &(t->object), GC_REFTYPE_THREADOBJECT);
+#endif
}
/* pre-compute the thinlock-word */
assert(t->index != 0);
t->thinlock = lock_pre_compute_thinlock(t->index);
+ t->flags = 0;
t->state = THREAD_STATE_NEW;
+#if defined(ENABLE_GC_CACAO)
+ t->flags |= THREAD_FLAG_IN_NATIVE;
+#endif
+
/* initialize the implementation-specific bits */
threads_impl_thread_new(t);
t = threads_thread_new();
- t->flags = THREAD_FLAG_INTERNAL | THREAD_FLAG_DAEMON;
+ t->flags |= THREAD_FLAG_INTERNAL | THREAD_FLAG_DAEMON;
/* The thread is flagged as (non-)daemon thread, we can leave the
mutex. */
/* this is a normal Java thread */
- thread->flags = THREAD_FLAG_JAVA;
+ thread->flags |= THREAD_FLAG_JAVA;
#if defined(ENABLE_JAVASE)
/* is this a daemon thread? */
void threads_thread_print_info(threadobject *t)
{
java_lang_Thread *object;
+#if defined(WITH_CLASSPATH_GNU)
+ java_lang_String *namestring;
+#endif
utf *name;
assert(t->state != THREAD_STATE_NEW);
/* get thread name */
#if defined(WITH_CLASSPATH_GNU)
- name = javastring_toutf((java_handle_t *) LLNI_field_direct(object, name), false);
+ LLNI_field_get_ref(object, name, namestring);
+ name = javastring_toutf((java_handle_t *) namestring, false);
#elif defined(WITH_CLASSPATH_SUN) || defined(WITH_CLASSPATH_CLDC1_1)
/* FIXME: In cldc the name is a char[] */
/* name = object->name; */