removes unnecessary LOCKXCHG operation to optimize.
authoryeom <yeom>
Sat, 13 Nov 2010 04:07:38 +0000 (04:07 +0000)
committeryeom <yeom>
Sat, 13 Nov 2010 04:07:38 +0000 (04:07 +0000)
Robust/src/Runtime/squeue.h

index ec30fd74893f2eb26a08a11fdf388d9d305f9583..b67f3b9210a4c11449772d6508d533459ebf69fe 100644 (file)
@@ -148,7 +148,8 @@ static inline void* dqPopTop(deque *p) {
     return item;
   } else {
     void * item=NULL;
-    item=(void *) LOCKXCHG((unsigned INTPTR*) &(realptr->work), (unsigned INTPTR) item);
+    if (realptr->work!=NULL)
+      item=(void *) LOCKXCHG((unsigned INTPTR*) &(realptr->work), (unsigned INTPTR) item);
     return item;
   }
 }