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

Merge pull request #2224 from synqa/revert-2221-fix-halt-flag

Revert "Fix data race on Tick64"
This commit is contained in:
Ilya Shipitsin
2026-02-08 17:25:04 +01:00
committed by GitHub

View File

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