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;
}
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;