From: bdemsky Date: Wed, 2 Dec 2009 19:21:38 +0000 (+0000) Subject: small edit X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d3c8c7f49a7351855a3ce69db2c60eba4ec0f283;p=IRC.git small edit --- 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; }