From f2c0b82ecf0c4415be79cbd6eb21c4362a209fd2 Mon Sep 17 00:00:00 2001 From: jihoonl Date: Tue, 23 Feb 2010 00:10:10 +0000 Subject: [PATCH] change --- Robust/src/Runtime/DSTM/interface_recovery/tlookup.c | 2 +- Robust/src/Runtime/DSTM/interface_recovery/trans.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Robust/src/Runtime/DSTM/interface_recovery/tlookup.c b/Robust/src/Runtime/DSTM/interface_recovery/tlookup.c index 494d1a5a..23b00a63 100644 --- a/Robust/src/Runtime/DSTM/interface_recovery/tlookup.c +++ b/Robust/src/Runtime/DSTM/interface_recovery/tlookup.c @@ -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; diff --git a/Robust/src/Runtime/DSTM/interface_recovery/trans.c b/Robust/src/Runtime/DSTM/interface_recovery/trans.c index fc52fbda..a544388e 100644 --- a/Robust/src/Runtime/DSTM/interface_recovery/trans.c +++ b/Robust/src/Runtime/DSTM/interface_recovery/trans.c @@ -3505,6 +3505,7 @@ void printRecoveryStat() { printf("Recovery Time(us) = %ld\n",recoverStat[i].elapsedTime); } printf("**************************\n\n"); + fflush(stdout); } #else void printRecoveryStat() { -- 2.34.1