From: jjenista Date: Fri, 5 Nov 2010 17:51:05 +0000 (+0000) Subject: without this barrier the compiler can optimize variable val out and the critical... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7629b37f8a21ec766e290337ac05889cbd459efa;p=IRC.git without this barrier the compiler can optimize variable val out and the critical first clause of the subseqeuent if statement is just lost, then when you expect val to be non-NULL in any call to getHead() the thread crashes --- diff --git a/Robust/src/Runtime/mlp_runtime.c b/Robust/src/Runtime/mlp_runtime.c index 2adeb1d1..7f8395dd 100644 --- a/Robust/src/Runtime/mlp_runtime.c +++ b/Robust/src/Runtime/mlp_runtime.c @@ -977,6 +977,7 @@ void resolvePointer(REntry* rentry){ do { val=(struct Queue*)0x1; val=(struct Queue*)LOCKXCHG((unsigned INTPTR*)&(table->unresolvedQueue), (unsigned INTPTR)val); + BARRIER(); } while(val==(struct Queue*)0x1); if(val!=NULL && getHead(val)!=NULL &&