From: yeom Date: Sat, 13 Nov 2010 04:07:38 +0000 (+0000) Subject: removes unnecessary LOCKXCHG operation to optimize. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e600b4eb22e7d27d5211c427d39d39ef5eeae8a0;p=IRC.git removes unnecessary LOCKXCHG operation to optimize. --- 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; } }