From: bdemsky Date: Mon, 11 Apr 2011 09:28:00 +0000 (+0000) Subject: good for a little more speedup... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5bf1e26f1e1493d373a734eafabbc1204a9191a8;p=IRC.git good for a little more speedup... --- diff --git a/Robust/src/Runtime/object.c b/Robust/src/Runtime/object.c index 6cd8da70..091b1218 100644 --- a/Robust/src/Runtime/object.c +++ b/Robust/src/Runtime/object.c @@ -57,7 +57,7 @@ void CALL01(___Object______MonitorEnter____, struct ___Object___ * ___this___) { lpair->islastlock=1; while(1) { if (VAR(___this___)->lockcount==0) { - if (CAS32(&VAR(___this___)->lockcount, 0, 1)==0) { + if (LOCKXCHG32(&VAR(___this___)->lockcount, 1)==0) { VAR(___this___)->tid=self; return; } @@ -104,7 +104,7 @@ void CALL01(___Object______wait____, struct ___Object___ * ___this___) { while(1) { if (VAR(___this___)->lockcount==0) { - if (CAS32(&VAR(___this___)->lockcount, 0, 1)==0) { + if (LOCKXCHG32(&VAR(___this___)->lockcount, 1)==0) { VAR(___this___)->tid=self; BARRIER(); return;