/*
__thread struct Queue* seseCallStack;
__thread pthread_once_t mlpOnceObj = PTHREAD_ONCE_INIT;
-void mlpInitOncePerThread() {
+void mlpInitOncePerThread() {
seseCallStack = createQueue();
}
*/
//chain of bins exists => tail is valid
//if there is something in front of us, then we are not ready
- int retval;
+ int retval=NOTREADY;
BinElement* be=T->array[key];
BinItem *bintail=be->tail;
b->item.total=1;
// note: If current table clears all dependencies, then write bin is ready
- if (T->item.total==0){
- retval=READY;
- }else{
- retval=NOTREADY;
- }
- b->item.status=retval;
- // b->item.status=NOTREADY;
+
if(inc){
atomic_inc(&T->item.total);
r->binitem=(BinItem*)b;
be->tail->next=(BinItem*)b;
+ //need to check if we can go...
+ BARRIER();
+ if (T->item.status==READY) {
+ for(;val!=NULL;val=val->next) {
+ if (val==((BinItem *)b)) {
+ //ready to retire
+ retval=READY;
+ if (isParent(r)) {
+ b->item.status=retval;//unsure if really needed at this point..
+ be->head=NULL; // released lock
+ return retval;
+ }
+ break;
+ } else if (val->total!=0) {
+ break;
+ }
+ }
+ }
+
+ b->item.status=retval;
be->tail=(BinItem*)b;
be->head=val;
return retval;
} else if((BinItem*)rptr==val) {
val=val->next;
}
- rptr->item.status=READY; {
- }
-
+ rptr->item.status=READY;
}
- ptr=ptr->next;
+ ptr=ptr->next;
}while(ptr!=NULL);
}
bin->head=val; // released lock;
}
void rehashMemoryQueue(SESEcommon_p seseParent){
+#if 0
// update memory queue
int i,binidx;
for(i=0; i<seseParent->numMemoryQueue; i++){
memoryItem=memoryItem->next;
}
}
-
+#endif
}