From 5bf1e26f1e1493d373a734eafabbc1204a9191a8 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Mon, 11 Apr 2011 09:28:00 +0000 Subject: [PATCH] good for a little more speedup... --- Robust/src/Runtime/object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.34.1