Skip to content

Commit da8fdce

Browse files
committed
xrGame: implement linux _InterlockedCompareExchange()
1 parent 4279461 commit da8fdce

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/xrGame/GameObject.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,11 @@ void CGameObject::MakeMeCrow()
114114
u32 const object_frame_id = dwFrame_AsCrow;
115115
#ifndef LINUX // FIXME!!!
116116
if ((u32)_InterlockedCompareExchange((long*)&dwFrame_AsCrow, device_frame_id, object_frame_id) == device_frame_id)
117-
return;
117+
#else
118+
if (__sync_val_compare_and_swap((long*)&dwFrame_AsCrow, object_frame_id, device_frame_id) == device_frame_id)
118119
#endif
120+
return;
121+
119122
VERIFY(dwFrame_AsCrow == device_frame_id);
120123
Props.crow = 1;
121124
g_pGameLevel->Objects.o_crow(this);

0 commit comments

Comments
 (0)