closer to compiling
authorbdemsky <bdemsky>
Mon, 6 Apr 2009 22:48:15 +0000 (22:48 +0000)
committerbdemsky <bdemsky>
Mon, 6 Apr 2009 22:48:15 +0000 (22:48 +0000)
Robust/src/Analysis/Locality/LocalityAnalysis.java
Robust/src/Runtime/STM/stm.c
Robust/src/Runtime/STM/tm.h
Robust/src/Runtime/garbage.c
Robust/src/Runtime/thread.c
Robust/src/Runtime/thread.h
Robust/src/buildscript

index 6376922cf4af10017f761cd2033685d0d8bfb405..889116c44c18f141673eea597d4402b92053e841 100644 (file)
@@ -332,9 +332,9 @@ public class LocalityAnalysis {
        assert(nodemd.getModifiers().isNative());
 
        MethodDescriptor runmd=null;
-       for(Iterator methodit=nodemd.getClassDesc().getMethodTable().getSet("run").iterator(); methodit.hasNext();) {
+       for(Iterator methodit=nodemd.getClassDesc().getMethodTable().getSet("staticStart").iterator(); methodit.hasNext();) {
          MethodDescriptor md=(MethodDescriptor) methodit.next();
-         if (md.numParameters()!=0||md.getModifiers().isStatic())
+         if (md.numParameters()!=1||!md.getModifiers().isStatic()||!md.getParamType(0).getSymbol().equals(TypeUtil.ThreadClass))
            continue;
          runmd=md;
          break;
index 79f15a9369876c4a3589dac80ffc7279c8afd103..ae19d71181fbe95172bc0b1a4d13fa20cca9a137 100644 (file)
@@ -41,6 +41,17 @@ objstr_t *objstrCreate(unsigned int size) {
   return tmp;
 }
 
+//free entire list, starting at store
+void objstrDelete(objstr_t *store) {
+  objstr_t *tmp;
+  while (store != NULL) {
+    tmp = store->next;
+    free(store);
+    store = tmp;
+  }
+  return;
+}
+
 /* =================================================
  * transStart
  * This function initializes things required in the 
@@ -352,7 +363,7 @@ int transAbortProcess(unsigned int *oidrdlocked, int *numoidrdlocked, unsigned i
  *
  * =================================
  */
-int transCommmitProcess(unsigned int *oidcreated, int *numoidcreated, unsigned int *oidrdlocked, int *numoidrdlocked,
+int transCommitProcess(unsigned int *oidcreated, int *numoidcreated, unsigned int *oidrdlocked, int *numoidrdlocked,
                     unsigned int *oidwrlocked, int *numoidwrlocked) {
   objheader_t *header, *tcptr;
   void *ptrcreate;
@@ -402,9 +413,6 @@ int transCommmitProcess(unsigned int *oidcreated, int *numoidcreated, unsigned i
     }
 
     header->version += 1;
-    if(header->notifylist != NULL) {
-      notifyAll(&header->notifylist, OID(header), header->version);
-    }
   }
   
   /* Release read locks */
index 86f80d797708c945e93e3616b4f9f1b6bb09302b..65a2afeb3c3e195ac36ccc47013fdeadd1b3838b 100644 (file)
@@ -119,6 +119,7 @@ typedef struct newObjCreated {
  * ================================
  */
 int stmStartup();
+void objstrDelete(objstr_t *store);
 objstr_t *objstrCreate(unsigned int size);
 void transStart();
 objheader_t *transCreateObj(unsigned int size);
index 081eec74569373310d7f8593cbe6cc144e0ddcd9..96335d00eceac4a3ca265a6629d45ebc9dd17866 100644 (file)
@@ -420,7 +420,7 @@ void * tomalloc(int size) {
   return ptr;
 }
 
-#if defined(THREADS)||defined(DSTM)
+#if defined(THREADS)||defined(DSTM)||defined(STM)
 void checkcollect(void * ptr) {
   struct listitem * tmp=stopforgc((struct garbagelist *)ptr);
   pthread_mutex_lock(&gclock); // Wait for GC
index c07d5d21966a4143520dadf0ebb85e41b7e7b379..5fe7da5c8fc5dbf6b99b4d48f41f96f7eb21a1c0 100644 (file)
@@ -111,7 +111,11 @@ void initializethreads() {
 void initthread(struct ___Thread___ * ___this___) {
 #ifdef PRECISE_GC
   int p[]={1, (int) NULL, (int) ___this___};
+#ifdef THREADS
   ___Thread______staticStart____L___Thread___((struct ___Thread______staticStart____L___Thread____params *)p);
+#else
+ ___Thread____NN____staticStart____L___Thread___((struct ___Thread____NN____staticStart____L___Thread____params *)p);
+#endif
   ___this___=(struct ___Thread___ *) p[2];
 #else
   ___Thread______staticStart____L___Thread___(___this___);
index e5388ab5985e313b1f1ff9259d137c9144df298f..26dd0e1c58866fdd5dd0785d37b17a37870c3f00 100644 (file)
@@ -10,7 +10,7 @@ extern pthread_cond_t gccond;
 extern pthread_mutex_t objlock;
 extern pthread_cond_t objcond;
 extern pthread_key_t threadlocks;
-#ifdef THREADS
+#if defined(THREADS)||defined(STM)
 void initthread(struct ___Thread___ * ___this___);
 #endif
 #ifdef DSTM
index a1104d5fbc6822e9f0e61cdc4ffc25bd59f057fa..f329e9bca59350b8d2e628d58dd654753072810c 100755 (executable)
@@ -485,7 +485,7 @@ fi
 if $SINGLETM
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -I$DSMRUNTIME"
-FILES="$FILES $DSMRUNTIME/dsmlock.c $DSMRUNTIME/singleTMCommit.c $DSMRUNTIME/clookup.c"
+FILES="$FILES $DSMRUNTIME/dsmlock.c $DSMRUNTIME/singleTMCommit.c $DSMRUNTIME/clookup.c $ROBUSTROOT/Runtime/thread.c"
 fi
 
 if $ABORTREADERS