From d3c8c7f49a7351855a3ce69db2c60eba4ec0f283 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Wed, 2 Dec 2009 19:21:38 +0000 Subject: [PATCH] small edit --- Robust/src/Runtime/DSTM/interface/altmlookup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Robust/src/Runtime/DSTM/interface/altmlookup.c b/Robust/src/Runtime/DSTM/interface/altmlookup.c index 88768dde..49825187 100644 --- a/Robust/src/Runtime/DSTM/interface/altmlookup.c +++ b/Robust/src/Runtime/DSTM/interface/altmlookup.c @@ -42,7 +42,7 @@ void mhashInsert(unsigned int key, void *val) { } unsigned int keyindex=(key&mlookup.mask)>>1; - volatile unsigned int * lockptr=&mlookup.larray[keyindex&LOCKMASK].lock; + volatile unsigned int * lockptr=&mlookup.larray[keyindex&LOCKAMASK].lock; while(!write_trylock(lockptr)) { sched_yield(); } @@ -70,7 +70,7 @@ void *mhashSearch(unsigned int key) { unsigned int keyindex=(key&mlookup.mask)>>1; volatile unsigned int * lockptr=&mlookup.larray[keyindex&LOCKMASK].lock; - while(!write_trylock(lockptr)) { + while(!read_trylock(lockptr)) { sched_yield(); } @@ -84,7 +84,7 @@ void *mhashSearch(unsigned int key) { } node = node->next; } while (node!=NULL); - write_unlock(lockptr); + read_unlock(lockptr); return NULL; } -- 2.34.1