-#if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
-
- h = builtin_new(class_java_lang_VMThread);
-
- if (h == NULL)
- return false;
-
- // Create and initialize a java.lang.VMThread object.
- java_lang_VMThread jlvmt(h, jlt.get_handle(), t);
-
- /* Call:
- java.lang.Thread.<init>(Ljava/lang/VMThread;Ljava/lang/String;IZ)V */
-
- bool isdaemon = thread_is_daemon(t);
-
- (void) vm_call_method(thread_method_init, jlt.get_handle(), jlvmt.get_handle(),
- name, NORM_PRIORITY, isdaemon);
-
- if (exceptions_get_exception())
- return false;
-
- // Set the ThreadGroup in the Java thread object.
- jlt.set_group(group);
-
- /* Add thread to the threadgroup. */
-
- classinfo* c;
- LLNI_class_get(group, c);
-
- methodinfo* m = class_resolveclassmethod(c,
- utf_addThread,
- utf_java_lang_Thread__V,
- class_java_lang_ThreadGroup,
- true);
-
- if (m == NULL)
- return false;
-
- (void) vm_call_method(m, group, jlt.get_handle());
-
- if (exceptions_get_exception())
- return false;
-
-#elif defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
-
- /* Set the priority. java.lang.Thread.<init> requires it because
- it sets the priority of the current thread to the parent's one
- (which is the current thread in this case). */
- jlt.set_priority(NORM_PRIORITY);
-
- // Call: java.lang.Thread.<init>(Ljava/lang/ThreadGroup;Ljava/lang/String;)V
-
- (void) vm_call_method(thread_method_init, jlt.get_handle(), group, name);
-
- if (exceptions_get_exception())
- return false;
-
-#elif defined(WITH_JAVA_RUNTIME_LIBRARY_CLDC1_1)
-
- // Set the thread data-structure in the Java thread object.
- jlt.set_vm_thread(t);
-
- // Call: public Thread(Ljava/lang/String;)V
- (void) vm_call_method(thread_method_init, jlt.get_handle(), name);
-
- if (exceptions_get_exception())
- return false;
-
-#else
-# error unknown classpath configuration
-#endif
-
- return true;
-}
-
-
-/* thread_create_initial_threadgroups ******************************************
-
- Create the initial threadgroups.
-
- GNU Classpath:
- Create the main threadgroup only and set the system
- threadgroup to the main threadgroup.
-
- SUN:
- Create the system and main threadgroup.
-
- CLDC:
- This function is a no-op.
-
-*******************************************************************************/
-
-static void thread_create_initial_threadgroups(void)
-{
-#if defined(ENABLE_JAVASE)
-# if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
-
- /* Allocate and initialize the main thread group. */
-
- threadgroup_main = native_new_and_init(class_java_lang_ThreadGroup);
-
- if (threadgroup_main == NULL)
- vm_abort("thread_create_initial_threadgroups: failed to allocate main threadgroup");
-
- /* Use the same threadgroup for system as for main. */
-
- threadgroup_system = threadgroup_main;
-
-# elif defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
-
- java_handle_t *name;
- methodinfo *m;
-
- /* Allocate and initialize the system thread group. */
-
- threadgroup_system = native_new_and_init(class_java_lang_ThreadGroup);
-
- if (threadgroup_system == NULL)
- vm_abort("thread_create_initial_threadgroups: failed to allocate system threadgroup");
-
- /* Allocate and initialize the main thread group. */
-
- threadgroup_main = builtin_new(class_java_lang_ThreadGroup);
-
- if (threadgroup_main == NULL)
- vm_abort("thread_create_initial_threadgroups: failed to allocate main threadgroup");
-
- name = javastring_new(utf_main);
-
- m = class_resolveclassmethod(class_java_lang_ThreadGroup,
- utf_init,
- utf_Ljava_lang_ThreadGroup_Ljava_lang_String__V,
- class_java_lang_ThreadGroup,
- true);
-
- if (m == NULL)
- vm_abort("thread_create_initial_threadgroups: failed to resolve threadgroup init method");
-
- (void) vm_call_method(m, threadgroup_main, threadgroup_system, name);
-
- if (exceptions_get_exception())
- vm_abort("thread_create_initial_threadgroups: exception while initializing main threadgroup");
-
-# else
-# error unknown classpath configuration
-# endif
-#endif