cmThread.c : Changed cmThPtrCAS() to select the CAS system call based on
OS_64 when compiling under OSX. This allows backward compatibility with older version of OSX.
This commit is contained in:
parent
5307482f6e
commit
cb19fb10a2
11
cmThread.c
11
cmThread.c
@ -1302,7 +1302,11 @@ bool cmThPtrCAS( void* addr, void* old, void* neww )
|
||||
union
|
||||
{
|
||||
void* addr;
|
||||
#ifdef OS_64
|
||||
int64_t val;
|
||||
#else
|
||||
int val;
|
||||
#endif
|
||||
} u;
|
||||
} s_t;
|
||||
|
||||
@ -1310,10 +1314,11 @@ bool cmThPtrCAS( void* addr, void* old, void* neww )
|
||||
|
||||
ov.u.addr = old;
|
||||
nv.u.addr = neww;
|
||||
|
||||
#ifdef OS_64
|
||||
int rv = OSAtomicCompareAndSwap64Barrier(ov.u.val,nv.u.val,(int64_t*)addr);
|
||||
|
||||
//int rv = OSAtomicCompareAndSwapPtrBarrier(old,neww,&addr);
|
||||
#else
|
||||
int rv = OSAtomicCompareAndSwap32Barrier(ov.u.val,nv.u.val,(int*)addr);
|
||||
#endif
|
||||
return rv;
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user