}
if(state.RCR) {
//no need to enqueue parent effect if coarse grained conflict clears us
+ output.println(" while(stallrecord.common.rcrstatus) ;");
+ output.println(" BARRIER();");
output.println(" stallrecord.common.parentsStallSem=&rentry->parentStallSem;");
output.println(" stallrecord.tag=rentry->tag;");
output.println(" stallrecord.___obj___=(struct ___Object___ *)"+generateTemp(fm, waitingElement.getTempDesc(), null)+";");
output.println(" stallrecord.common.classID=-"+rcr.getTraverserID(waitingElement.getTempDesc(), fn)+";");
+ //mark the record used..so we won't use it again until it is free
+ output.println(" stallrecord.common.rcrstatus=1;");
output.println(" enqueueTR(TRqueue, (void *)&stallrecord);");
}
output.println(" psem_take( &(rentry->parentStallSem), (struct garbagelist *)&___locals___ );");
//need to add this
cFile.println(" if(atomic_sub_and_test(RUNBIAS-totalcount,&(record->rcrRecords[0].count))) {");
cFile.println(" psem_give_tag(record->common.parentsStallSem, record->tag);");
+ cFile.println(" BARRIER();");
+ cFile.println(" record->common.rcrstatus=0;");
cFile.println("}");
} else {
cFile.println(" if(atomic_sub_and_test(RUNBIAS-totalcount,&(record->rcrRecords["+index+"].count))) {");
//ForwardingListElement forwardList;
struct Queue* forwardList;
-
volatile int unresolvedDependencies;
pthread_cond_t doneCond;
int offsetToDepSESErecords;
#ifdef RCR
int offsetToParamRecords;
+ volatile int rcrstatus;
#endif
// for determining when task records can be returned
if(unlikely(record->classID<0)) {
//parent stall...clear it
psem_give_tag(record->parentsStallSem, ((SESEstall *)record)->tag);
+ //mark the record unused
+ BARRIER();
+ ((SESEstall *)record)->rcrstatus=0;
} else {
int flag=LOCKXCHG32(&array[index].flag,0);
if (flag) {
//set up the stall site SESErecord
stallrecord.common.offsetToParamRecords=(INTPTR) &((SESEstall *)0)->rcrRecords;
stallrecord.common.classID=-1;
+ stallrecord.common.rcrstatus=0;
if( TRqueue == NULL ) {
TRqueue = allocTR();