#define ISREADBIN(x) (!(x&BINMASK))
//#define POPCOUNT(x) __builtin_popcountll(x)
//__builtin_popcountll
+#define ONEVAL 1ULL
inline enqueuerecord(struct rcrRecord *rcrrec, int tmpkey, BinItem_rcr *item) {
//common to both types
td->task=task;
- td->bitindexrd=td->bitindexwr=1<<index;
+ td->bitindexrd=td->bitindexwr=ONEVAL<<index;
be->tail=b;
BARRIER();//do tail before head
//release lock
//last one is to check for SESE blocks in a while loop.
if(unlikely(td->task == task)) {
- bitvt bit=1<<index;
+ bitvt bit=ONEVAL<<index;
if (!(bit & td->bitindexwr)) {
td->bitindexwr|=bit;
td->bitindexrd|=bit;
b->item.total=1;
b->task=task;
- bitvt bit=1<<index;
+ bitvt bit=ONEVAL<<index;
if (wrmask&bit) {
//count already includes this
status=SPECREADY;
//common to both types
td->task=task;
- td->bitindex=1<<index;
+ td->bitindex=ONEVAL<<index;
be->tail=b;
//release lock
WriteBinItem_rcr * td = (WriteBinItem_rcr *)bintail;
if(unlikely(td->task==task)) {
//RELEASE LOCK
- bitvt bit=1<<index;
+ bitvt bit=ONEVAL<<index;
int status=bintail->status;
if (!(td->bitindexrd & bit)) {
td->bitindexrd|=bit;
TraverserData * td = &((ReadBinItem_rcr *)bintail)->array[((ReadBinItem_rcr *)bintail)->index - 1];
if (unlikely(td->task==task)) {
//RELEASE LOCK
- bitvt bit=1<<index;
+ bitvt bit=ONEVAL<<index;
int status=bintail->status;
if (!(td->bitindex & bit)) {
td->bitindex|=bit;
}
td->task=task;
- td->bitindex=1<<index;
+ td->bitindex=ONEVAL<<index;
T->array[key].head=val;//released lock
return retval;
rb->item.status=NOTREADY;
td->task=task;
- td->bitindex=1<<index;
+ td->bitindex=ONEVAL<<index;
enqueuerecord(rcrrec, key, (BinItem_rcr *) rb);
T->array[key].tail->next=(BinItem_rcr*)rb;
for (i=0;i<rptr->index;i++) {
TraverserData * td=&rptr->array[i];
if (task==td->task) {
- RESOLVE(td->task, td->bitindex);
+ SESEcommon *record=td->task;
if (((INTPTR)rptr->array[i].task)&PARENTBIN) {
//parents go immediately
atomic_dec(&rptr->item.total);
+ record=(SESEcommon *)(((INTPTR)record)&~1ULL);
}
+ RESOLVE(record, td->bitindex);
break;
}
}
break;
if(ptr->status==NOTREADY) {
WriteBinItem_rcr* wptr=(WriteBinItem_rcr*)ptr;
- RESOLVE(wptr->task, wptr->bitindexwr);
+ RESOLVE((SESEcommon *)(((INTPTR)wptr->task)&~1ULL), wptr->bitindexwr);
ptr->status=READY;
if(((INTPTR)wptr->task)&PARENTBIN) {
val=val->next;