From: jjenista Date: Thu, 11 Nov 2010 01:35:46 +0000 (+0000) Subject: have to consider an empty, ready read bin in front of you if you are inserting a... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=18060711dfaf7e2f4cc5ff3a4e86bdbdcd446fd4;p=IRC.git have to consider an empty, ready read bin in front of you if you are inserting a write bin --- diff --git a/Robust/src/Runtime/oooJava/hashStructure.c b/Robust/src/Runtime/oooJava/hashStructure.c index 9eb89720..37909403 100644 --- a/Robust/src/Runtime/oooJava/hashStructure.c +++ b/Robust/src/Runtime/oooJava/hashStructure.c @@ -162,7 +162,7 @@ inline int rcr_BWRITEBINCASE(HashStructure *T, int key, SESEcommon *task, struct if (bintail->status==READY&&bintail->total==0) { //we may have to set write as ready - while(val->total==0) { + while(1) { if (val==((BinItem_rcr *)b)) { b->item.status=READY; be->head=val; @@ -172,7 +172,10 @@ inline int rcr_BWRITEBINCASE(HashStructure *T, int key, SESEcommon *task, struct enqueuerecord(rcrrec, key, (BinItem_rcr *) b); return READY; } + } else if (val->total!=0) { + break; } + //TODO: WHEN WE DO POOLALLOC, WE LEAK NODES HERE AND ACCESS THEM W/O LOCKING BIN... val=val->next; } }