1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2026-02-11 13:10:08 +03:00

Revert "Fix data race on Tick64"

This commit is contained in:
synqa
2026-02-08 23:14:09 +09:00
committed by GitHub
parent 9d27b935b7
commit 6016f84315

View File

@ -139,7 +139,6 @@ void Tick64Thread(THREAD *thread, void *param)
{ {
UINT tick; UINT tick;
UINT64 tick64; UINT64 tick64;
bool halt;
#ifndef OS_WIN32 #ifndef OS_WIN32
tick = TickRealtime(); // Get the current system clock tick = TickRealtime(); // Get the current system clock
@ -229,13 +228,7 @@ void Tick64Thread(THREAD *thread, void *param)
n = 0; n = 0;
} }
Lock(tk64->TickLock); if (tk64->Halt)
{
halt = tk64->Halt;
}
Unlock(tk64->TickLock);
if (halt)
{ {
break; break;
} }
@ -293,11 +286,7 @@ void FreeTick64()
} }
// Termination process // Termination process
Lock(tk64->TickLock); tk64->Halt = true;
{
tk64->Halt = true;
}
Unlock(tk64->TickLock);
Set(halt_tick_event); Set(halt_tick_event);
WaitThread(tk64->Thread, INFINITE); WaitThread(tk64->Thread, INFINITE);
ReleaseThread(tk64->Thread); ReleaseThread(tk64->Thread);