From 7629b37f8a21ec766e290337ac05889cbd459efa Mon Sep 17 00:00:00 2001 From: jjenista Date: Fri, 5 Nov 2010 17:51:05 +0000 Subject: [PATCH] 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 --- Robust/src/Runtime/mlp_runtime.c | 1 + 1 file changed, 1 insertion(+) 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 && -- 2.34.1