projects
/
cacao.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PR162: Make class init protection aware of multiple threads.
[cacao.git]
/
src
/
vm
/
class.hpp
diff --git
a/src/vm/class.hpp
b/src/vm/class.hpp
index 85f05618cafb5f6d2ec4e552bfa051bf6d2cbd2d..5b0c41c2e94846a23d54be3b8729523ef19f2205 100644
(file)
--- a/
src/vm/class.hpp
+++ b/
src/vm/class.hpp
@@
-1,6
+1,6
@@
/* src/vm/class.hpp - class related functions header
/* src/vm/class.hpp - class related functions header
- Copyright (C) 1996-20
05, 2006, 2007, 2008
+ Copyright (C) 1996-20
11
CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
This file is part of CACAO.
CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
This file is part of CACAO.
@@
-67,7
+67,7
@@
typedef struct extra_classref extra_classref;
/* some macros ****************************************************************/
#define CLASS_IS_OR_ALMOST_INITIALIZED(c) \
/* some macros ****************************************************************/
#define CLASS_IS_OR_ALMOST_INITIALIZED(c) \
- (((c)->state & CLASS_INITIALIZ
ING) || ((c)->state & CLASS_INITIALIZED
))
+ (((c)->state & CLASS_INITIALIZ
ED) || ((c)->state & CLASS_INITIALIZING && class_initializing_thread_is_self((c))
))
/* classinfo ******************************************************************/
/* classinfo ******************************************************************/
@@
-90,6
+90,8
@@
typedef struct {
#endif
} dummy_java_lang_Class;
#endif
} dummy_java_lang_Class;
+struct threadobject;
+
struct classinfo { /* class structure */
dummy_java_lang_Class object;
struct classinfo { /* class structure */
dummy_java_lang_Class object;
@@
-124,6
+126,7
@@
struct classinfo { /* class structure */
/* (interfaces) */
s4 instancesize; /* size of an instance of this class */
/* (interfaces) */
s4 instancesize; /* size of an instance of this class */
+ struct threadobject *initializing_thread;
vftbl_t *vftbl; /* pointer to virtual function table */
methodinfo *finalizer; /* finalizer method */
vftbl_t *vftbl; /* pointer to virtual function table */
methodinfo *finalizer; /* finalizer method */
@@
-424,6
+427,8
@@
java_handle_t *class_get_name(classinfo *c);
utf *class_get_signature(classinfo *c);
#endif
utf *class_get_signature(classinfo *c);
#endif
+bool class_initializing_thread_is_self(classinfo *c);
+
/* some debugging functions */
#if !defined(NDEBUG)
/* some debugging functions */
#if !defined(NDEBUG)
@@
-457,5
+462,6
@@
void class_showconstantpool(classinfo *c);
* indent-tabs-mode: t
* c-basic-offset: 4
* tab-width: 4
* indent-tabs-mode: t
* c-basic-offset: 4
* tab-width: 4
+ * vim:noexpandtab:sw=4:ts=4:
* End:
*/
* End:
*/