* src/threads/thread.cpp: Break a reference cycle.
[cacao.git] / src / threads / thread-classpath.hpp
1 /* src/threads/thread-classpath.hpp - thread functions specific to the GNU classpath library
2
3    Copyright (C) 1996-2011
4    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5
6    This file is part of CACAO.
7
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.
12
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.
17
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
21    02110-1301, USA.
22
23 */
24
25
26 #ifndef _THREAD_CLASSPATH_HPP
27 #define _THREAD_CLASSPATH_HPP
28
29 #ifdef __cplusplus
30
31 #include "config.h"
32
33 #include "vm/types.h"
34
35 // Include early to get threadobject.
36 #if defined(ENABLE_THREADS)
37 # include "threads/posix/thread-posix.hpp"
38 #else
39 # include "threads/none/thread-none.h"
40 #endif
41
42 class java_lang_Thread;
43
44 /* only define the following stuff with thread enabled ************************/
45
46 #if defined(ENABLE_THREADS) && defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
47
48 struct ThreadRuntimeClasspath {
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);
60         static void clear_heap_reference(java_lang_Thread& jlt);
61 };
62
63 typedef ThreadRuntimeClasspath ThreadRuntime;
64
65 #endif /* ENABLE_THREADS */
66
67 #endif  // __cplusplus
68
69 #endif // _THREAD_CLASSPATH_HPP
70
71
72 /*
73  * These are local overrides for various environment variables in Emacs.
74  * Please do not remove this and leave it at the end of the file, where
75  * Emacs will automagically detect them.
76  * ---------------------------------------------------------------------
77  * Local variables:
78  * mode: c++
79  * indent-tabs-mode: t
80  * c-basic-offset: 4
81  * tab-width: 4
82  * End:
83  * vim:noexpandtab:sw=4:ts=4:
84  */