Skip to content

Commit

Permalink
remove an unnecessary atomic load
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkautarch committed Jan 2, 2024
1 parent 64aedf9 commit b9ee613
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sdlwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ void inputSDLThreadRun( void )
{
bool sdlLatch_cached = g_sdlLatch.load(std::memory_order_relaxed);

if ( sdlLatch_cached == 0 && g_sdlLatch.load(std::memory_order_consume) == 0)
if ( sdlLatch_cached == 0)
g_sdlLatch.wait(0); //atomic wait is guaranteed to return only if value has changed, even if underlying implementation unblocks spuriously.
//https://en.cppreference.com/w/cpp/atomic/atomic/wait
else {
Expand Down

0 comments on commit b9ee613

Please sign in to comment.