Small modifications to compile under xcode.
This commit is contained in:
parent
091c1cbf8e
commit
83bbd0920f
|
@ -11,6 +11,10 @@ namespace mt{
|
||||||
|
|
||||||
class atomicInt
|
class atomicInt
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private:
|
||||||
|
volatile int _q_value;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
atomicInt()
|
atomicInt()
|
||||||
{
|
{
|
||||||
|
@ -76,7 +80,7 @@ does nothing and returns false.
|
||||||
// return true;
|
// return true;
|
||||||
// }
|
// }
|
||||||
//return false;
|
//return false;
|
||||||
return OSAtomicCompareAndSwap32Barrier(expectedValue, newValue, &_q_value));
|
return OSAtomicCompareAndSwap32Barrier(expectedValue, newValue, &_q_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Non-atomic API
|
// Non-atomic API
|
||||||
|
@ -117,8 +121,6 @@ does nothing and returns false.
|
||||||
return _q_value < value;
|
return _q_value < value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
volatile int _q_value;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue