* src/vm/jit/i386/darwin/md-os.c (md_replace_executionstate_read):
[cacao.git] / src / threads / none / threads.h
1 /* src/threads/none/threads.h - fake threads header
2
3    Copyright (C) 1996-2005, 2006, 2007, 2008
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 _THREADS_H
27 #define _THREADS_H
28
29 #include "config.h"
30
31 #include "vm/types.h"
32
33 #include "vm/global.h"
34
35 #include "vm/jit/stacktrace.h"
36
37
38 /* define some stuff we need to no-ops ****************************************/
39
40 #define THREADSPECIFIC
41 #define THREADOBJECT      NULL
42 #define THREADINFO        NULL
43
44 #define threadobject      void
45
46
47 /* native-world flags *********************************************************/
48
49 #define THREAD_NATIVEWORLD_ENTER /*nop*/
50 #define THREAD_NATIVEWORLD_EXIT  /*nop*/
51
52
53 #if defined(ENABLE_DEBUG_FILTER)
54 extern u2 _no_threads_filterverbosecallctr[2];
55 #define FILTERVERBOSECALLCTR (_no_threads_filterverbosecallctr)
56 #endif
57
58 /* state for trace java call **************************************************/
59
60 #if !defined(NDEBUG)
61 extern s4 _no_threads_tracejavacallindent;
62 #define TRACEJAVACALLINDENT (_no_threads_tracejavacallindent)
63
64 extern u4 _no_threads_tracejavacallcount;
65 #define TRACEJAVACALLCOUNT (_no_threads_tracejavacallcount)
66 #endif
67
68
69 /* inline functions ***********************************************************/
70
71 inline static java_handle_t *threads_get_current_object(void)
72 {
73         java_handle_t *o;
74
75         /* We return a fake java.lang.Thread object, otherwise we get
76            NullPointerException's in GNU Classpath. */
77
78         o = builtin_new(class_java_lang_Thread);
79
80         return o;
81 }
82
83 inline static stackframeinfo_t *threads_get_current_stackframeinfo(void)
84 {
85         return _no_threads_stackframeinfo;
86 }
87
88 inline static void threads_set_current_stackframeinfo(stackframeinfo_t *sfi)
89 {
90         _no_threads_stackframeinfo = sfi;
91 }
92
93 #endif /* _THREADS_H */
94
95
96 /*
97  * These are local overrides for various environment variables in Emacs.
98  * Please do not remove this and leave it at the end of the file, where
99  * Emacs will automagically detect them.
100  * ---------------------------------------------------------------------
101  * Local variables:
102  * mode: c
103  * indent-tabs-mode: t
104  * c-basic-offset: 4
105  * tab-width: 4
106  * End:
107  */