Skip to content

Commit

Permalink
Don't Access Volatile Variables Directly (#4561)
Browse files Browse the repository at this point in the history
  • Loading branch information
nibanks committed Sep 26, 2024
1 parent e0201eb commit a09a6de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/perf/lib/Tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ bool TcpWorker::Initialize(TcpEngine* _Engine, uint16_t PartitionIndex)
Engine = _Engine;
ExecutionContext.Callback = DoWork;
ExecutionContext.Context = this;
ExecutionContext.Ready = TRUE;
InterlockedFetchAndSetBoolean(&ExecutionContext.Ready); // TODO - Use WriteBooleanNoFence equivalent instead?
ExecutionContext.NextTimeUs = UINT64_MAX;

#ifndef _KERNEL_MODE // Not supported on kernel mode
Expand Down Expand Up @@ -282,7 +282,7 @@ TcpWorker::DoWork(
if (Connection) {
Connection->Process();
Connection->Release();
This->ExecutionContext.Ready = TRUE; // We just did work, let's keep this thread hot.
InterlockedFetchAndSetBoolean(&This->ExecutionContext.Ready); // We just did work, let's keep this thread hot.
State->NoWorkCount = 0;
}

Expand Down

0 comments on commit a09a6de

Please sign in to comment.