Skip to content

Commit

Permalink
xrGame: implement linux _InterlockedCompareExchange()
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed Nov 6, 2018
1 parent 4279461 commit da8fdce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/xrGame/GameObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,11 @@ void CGameObject::MakeMeCrow()
u32 const object_frame_id = dwFrame_AsCrow;
#ifndef LINUX // FIXME!!!
if ((u32)_InterlockedCompareExchange((long*)&dwFrame_AsCrow, device_frame_id, object_frame_id) == device_frame_id)
return;
#else
if (__sync_val_compare_and_swap((long*)&dwFrame_AsCrow, object_frame_id, device_frame_id) == device_frame_id)
#endif
return;

VERIFY(dwFrame_AsCrow == device_frame_id);
Props.crow = 1;
g_pGameLevel->Objects.o_crow(this);
Expand Down

0 comments on commit da8fdce

Please sign in to comment.