change
authorbdemsky <bdemsky>
Thu, 18 Nov 2010 06:30:28 +0000 (06:30 +0000)
committerbdemsky <bdemsky>
Thu, 18 Nov 2010 06:30:28 +0000 (06:30 +0000)
Robust/src/Runtime/oooJava/hashStructure.c

index a51e5f2e0a7d93f871ebf59a6d5cf68306cf826f..36876afe01be3f7e2e6eeecb3bf82e2083f05376 100644 (file)
@@ -257,6 +257,16 @@ inline int rcr_BREADBINCASE(HashStructure *T, int key, SESEcommon *task, struct
        return status;
       }
     }
+    rcr_TAILWRITECASE(T, val, bintail, key, task, rcrrec, index);
+    if (mode) {
+      struct BinItem_rcr * bt=be->tail;
+      while(bt->status!=READY) {
+       BARRIER();
+      }
+      return READY;
+    } else {
+      return NOTREADY;
+    }
   } else {
     TraverserData * td = &((ReadBinItem_rcr *)bintail)->array[((ReadBinItem_rcr *)bintail)->index - 1];
     if (unlikely(td->task==task)) {
@@ -275,9 +285,7 @@ inline int rcr_BREADBINCASE(HashStructure *T, int key, SESEcommon *task, struct
       }
       return status;
     }
-  }
 
-  if (ISREADBIN(bintail->type)) {
     if ((((INTPTR)task)&PARENTBIN)&&(bintail->status==READY)) {
       be->head=val;
       return READY;
@@ -293,17 +301,6 @@ inline int rcr_BREADBINCASE(HashStructure *T, int key, SESEcommon *task, struct
     } else {
       return stat;
     }
-  } else {
-    rcr_TAILWRITECASE(T, val, bintail, key, task, rcrrec, index);
-    if (mode) {
-      struct BinItem_rcr * bt=be->tail;
-      while(bt->status!=READY) {
-       BARRIER();
-      }
-      return READY;
-    } else {
-      return NOTREADY;
-    }
   }
 }