From e600b4eb22e7d27d5211c427d39d39ef5eeae8a0 Mon Sep 17 00:00:00 2001 From: yeom Date: Sat, 13 Nov 2010 04:07:38 +0000 Subject: [PATCH] removes unnecessary LOCKXCHG operation to optimize. --- Robust/src/Runtime/squeue.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Robust/src/Runtime/squeue.h b/Robust/src/Runtime/squeue.h index ec30fd74..b67f3b92 100644 --- a/Robust/src/Runtime/squeue.h +++ b/Robust/src/Runtime/squeue.h @@ -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; } } -- 2.34.1