From 58053735a466f7ba0e967b4b141803184d82f519 Mon Sep 17 00:00:00 2001 From: adash Date: Tue, 12 May 2009 00:41:54 +0000 Subject: [PATCH] bug fix: acquire lock before copying the object into cache --- Robust/src/Runtime/STM/stm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Robust/src/Runtime/STM/stm.c b/Robust/src/Runtime/STM/stm.c index ddd4cfe6..234f2391 100644 --- a/Robust/src/Runtime/STM/stm.c +++ b/Robust/src/Runtime/STM/stm.c @@ -247,7 +247,6 @@ __attribute__((pure)) void *transRead(void * oid, void *gl) { GETSIZE(size, header); size += sizeof(objheader_t); objcopy = (objheader_t *) objstrAlloc(size); - memcpy(objcopy, header, size); #ifdef STMSTATS header->accessCount++; //FIXME riskratio fix @@ -259,6 +258,7 @@ __attribute__((pure)) void *transRead(void * oid, void *gl) { needLock(header,gl); } #endif + memcpy(objcopy, header, size); /* Insert into cache's lookup table */ STATUS(objcopy)=0; t_chashInsert(oid, &objcopy[1]); -- 2.34.1