CACAO
thread-none.hpp
Go to the documentation of this file.
1 /* src/threads/none/thread-none.hpp - fake threads header
2 
3  Copyright (C) 1996-2013
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_NONE_HPP_
27 #define THREAD_NONE_HPP_ 1
28 
29 #ifndef THREAD_HPP_
30 # error "Do not directly include this header, include threads/thread.hpp instead"
31 #endif
32 
33 #include "config.h"
34 
35 #include <stdint.h>
36 
37 #include "vm/types.hpp"
38 
39 #include "vm/jit/builtin.hpp"
40 #include "vm/globals.hpp"
41 
42 #include "vm/jit/stacktrace.hpp"
43 
44 
45 /* global variables ***********************************************************/
46 
47 #define THREADOBJECT thread_current
48 
50 
51 /* inline functions ***********************************************************/
52 
53 /**
54  * Return the threadobject for the current thread.
55  */
56 inline static threadobject* thread_get_current() {
57  return thread_current;
58 }
59 
60 /**
61  * Set the threadobject for the current thread.
62  */
63 inline static void thread_set_current(threadobject* t)
64 {
65  thread_current = t;
66 }
67 
68 #endif // THREAD_NONE_HPP_
69 
70 
71 /*
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  * ---------------------------------------------------------------------
76  * Local variables:
77  * mode: c++
78  * indent-tabs-mode: t
79  * c-basic-offset: 4
80  * tab-width: 4
81  * End:
82  */
threadobject * thread_current
Definition: thread-none.cpp:41
static threadobject * thread_get_current()
Return the threadobject for the current thread.
Definition: thread-none.hpp:56
static void thread_set_current(threadobject *t)
Set the threadobject for the current thread.
Definition: thread-none.hpp:63