mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2026-03-09 17:59:19 +03:00
Compare commits
4 Commits
9d27b935b7
...
b551b77e25
| Author | SHA1 | Date | |
|---|---|---|---|
| b551b77e25 | |||
| 609b8f4a5e | |||
| 0a87ff8fbd | |||
| 6016f84315 |
@ -72,11 +72,26 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, char *CmdLine, int CmdShow)
|
||||
|
||||
// Compiler dependent
|
||||
#ifndef OS_WIN32
|
||||
// Gcc compiler
|
||||
// GCC or Clang compiler
|
||||
#define GCC_PACKED __attribute__ ((__packed__))
|
||||
// Clang compiler
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(thread_sanitizer)
|
||||
#define ATTRIBUTE_NO_TSAN __attribute__((no_sanitize("thread")))
|
||||
#endif // __has_feature(thread_sanitizer)
|
||||
#endif // __has_feature
|
||||
// GCC compiler
|
||||
#if defined(__SANITIZE_THREAD__) && !defined(ATTRIBUTE_NO_TSAN)
|
||||
#define ATTRIBUTE_NO_TSAN __attribute__((no_sanitize("thread")))
|
||||
#endif // __SANITIZE_THREAD__
|
||||
// Other or older Clang/GCC compiler
|
||||
#ifndef ATTRIBUTE_NO_TSAN
|
||||
#define ATTRIBUTE_NO_TSAN
|
||||
#endif // ATTRIBUTE_NO_TSAN
|
||||
#else // OS_WIN32
|
||||
// VC++ compiler
|
||||
#define GCC_PACKED
|
||||
#define ATTRIBUTE_NO_TSAN
|
||||
#endif // OS_WIN32
|
||||
|
||||
// Macro that displays the current file name and line number
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user