1 /* src/threads/thread-cldc11.hpp - thread functions specific to the CLDC 1.1 library
3 Copyright (C) 1996-2011
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 #ifndef _THREAD_CLDC11_HPP
27 #define _THREAD_CLDC11_HPP
35 // Include early to get threadobject.
36 #if defined(ENABLE_THREADS)
37 # include "threads/posix/thread-posix.hpp"
39 # include "threads/none/thread-none.h"
42 class java_lang_Thread;
44 /* only define the following stuff with thread enabled ************************/
46 #if defined(ENABLE_THREADS) && defined(WITH_JAVA_RUNTIME_LIBRARY_CLDC1_1)
48 struct ThreadRuntimeCldc11 {
49 static classinfo *get_thread_class_from_object(java_handle_t *object);
50 static java_handle_t *get_vmthread_handle(const java_lang_Thread &jlt);
51 static java_handle_t *get_thread_exception_handler(const java_lang_Thread &jlt);
52 static methodinfo *get_threadgroup_remove_method(classinfo *c);
53 static methodinfo *get_thread_init_method();
54 static void setup_thread_vmdata(const java_lang_Thread& jlt, threadobject *t);
55 static void print_thread_name(const java_lang_Thread& jlt, FILE *stream);
56 static void set_javathread_state(threadobject *t, int state);
57 static threadobject *get_threadobject_from_thread(java_handle_t *h);
58 static void thread_create_initial_threadgroups(java_handle_t **threadgroup_system, java_handle_t **threadgroup_main);
59 static bool invoke_thread_initializer(java_lang_Thread& jlt, threadobject *t, methodinfo *thread_method_init, java_handle_t *name, java_handle_t *group);
62 typedef ThreadRuntimeCldc11 ThreadRuntime;
64 #endif /* ENABLE_THREADS */
68 #endif // _THREAD_CLDC11_HPP
72 * These are local overrides for various environment variables in Emacs.
73 * Please do not remove this and leave it at the end of the file, where
74 * Emacs will automagically detect them.
75 * ---------------------------------------------------------------------
82 * vim:noexpandtab:sw=4:ts=4: