change
authorjihoonl <jihoonl>
Tue, 23 Feb 2010 00:10:10 +0000 (00:10 +0000)
committerjihoonl <jihoonl>
Tue, 23 Feb 2010 00:10:10 +0000 (00:10 +0000)
Robust/src/Runtime/DSTM/interface_recovery/tlookup.c
Robust/src/Runtime/DSTM/interface_recovery/trans.c

index 494d1a5a5ee8ec562e46eceb2f9571f5772a5b2f..23b00a63331baf6719c89517570a38a9415cad06 100644 (file)
@@ -41,6 +41,7 @@ unsigned int thashInsert(unsigned int transid, char decision) {
     pthread_mutex_unlock(&tlookup.locktable);
   }
 
+  pthread_mutex_lock(&tlookup.locktable);
   index = thashFunction(transid);
   ptr = tlookup.table;
   tlookup.numelements++;
@@ -48,7 +49,6 @@ unsigned int thashInsert(unsigned int transid, char decision) {
 #ifdef DEBUG
   printf("DEBUG(insert) transid = %d, decision  = %d, index = %d\n",transid, decision, index);
 #endif
-  pthread_mutex_lock(&tlookup.locktable);
   if(ptr[index].next == NULL && ptr[index].transid == 0) {          // Insert at the first position in the hashtable
     ptr[index].transid = transid;
     ptr[index].decision = decision;
index fc52fbdab23ce72c58e19795083a74eb9f669169..a544388eced0cd38d87eadcfd46e033e47c5a7a5 100644 (file)
@@ -3505,6 +3505,7 @@ void printRecoveryStat() {
     printf("Recovery Time(us) = %ld\n",recoverStat[i].elapsedTime);
   }
   printf("**************************\n\n");
+  fflush(stdout);
 }
 #else
 void printRecoveryStat() {