outmethod.println("#include \"multicoreruntime.h\"");
outmethod.println("#include \"runtime_arch.h\"");
}
- if (state.THREAD||state.DSM||state.SINGLETM)
- outmethod.println("#include <thread.h>");
+ if (state.THREAD||state.DSM||state.SINGLETM) {
+ if(state.MGC) {
+ outmethod.println("#include \"thread.h\"");
+ } else {
+ outmethod.println("#include <thread.h>");
+ }
+ }
if (state.main!=null) {
outmethod.println("#include <string.h>");
}
Iterator it_sclasses = sctbl.getDescriptorsIterator();
while(it_sclasses.hasNext()) {
ClassDescriptor t_cd = (ClassDescriptor)it_sclasses.next();
+ if(t_cd.getNumStaticFields() != 0) {
+ // TODO may need to invoke static field initialization here
+ }
MethodDescriptor t_md = (MethodDescriptor)t_cd.getMethodTable().get("staticblocks");
outmethod.println(" {");
if ((GENERATEPRECISEGC) || (this.state.MULTICOREGC)) {
state.MULTICORE=true;
else if (option.equals("-multicoregc"))
state.MULTICOREGC=true;
- else if (option.equals("-mgc"))
+ else if (option.equals("-mgc")) {
state.MGC = true;
- else if (option.equals("-ownership"))
+ state.THREAD = true;
+ } else if (option.equals("-ownership"))
state.OWNERSHIP=true;
else if (option.equals("-ownallocdepth")) {
state.OWNERSHIPALLOCDEPTH=Integer.parseInt(args[++i]);
this.count = 0;
}
- public synchronized void add(long value){
- this.count += value;
+ public add(long value){
+ synchronized (this) {
+ this.count += value;
+ }
}
public synchronized long getCounter() {