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

Compare commits

...

4 Commits

Author SHA1 Message Date
61b920f957 Merge pull request #2239 from synqa/add-comment-unix-lock
Add comment for UnixLock
2026-02-21 15:36:51 +01:00
290f125abc Merge pull request #2240 from synqa/suppress-tsan-threadpoolproc
Suppress Thread Sanitizer for ThreadPoolProc
2026-02-21 15:35:56 +01:00
93bf90ba95 Add comment for UnixLock
The Lock/Unlock mechanism on Unix is a manual, hand-coded implementation
of PTHREAD_MUTEX_RECURSIVE. We avoid using the PTHREAD_MUTEX_RECURSIVE
directly because it exhibits critical bugs, such as deadlocks on
certain older systems(Linux, Solaris, or macOS).
followup #2219
2026-02-21 21:15:56 +09:00
5b356616a7 Suppress Thread Sanitizer for ThreadPoolProc
Thread Sanitizer reports data races on PoolHalting in THREAD, shared
between ThreadPoolProc and WaitThread. But if WaitThread reads false,
synchronization is ensured by Wait from the PoolWaitList. If it reads
true, WaitThread simply returns.
2026-02-21 20:26:39 +09:00
2 changed files with 6 additions and 0 deletions

View File

@ -1849,6 +1849,8 @@ void UnixUnlockEx(LOCK *lock, bool inner)
}
// Lock
// Recursive locking is implemented manually instead of using PTHREAD_MUTEX_RECURSIVE.
// See: https://github.com/SoftEtherVPN/SoftEtherVPN/pull/2219
bool UnixLock(LOCK *lock)
{
pthread_mutex_t *mutex;

View File

@ -17,6 +17,10 @@ race_top:BindConnectThreadForIPv4
race_top:BindConnectThreadForIPv6
race_top:BindConnectEx5
# Thread Sanitizer reports data races on PoolHalting in THREAD, shared between ThreadPoolProc and WaitThread.
# But if WaitThread reads false, synchronization is ensured by Wait from the PoolWaitList. If it reads true,
# WaitThread simply returns.
race_top:ThreadPoolProc
## Manual PTHREAD_MUTEX_RECURSIVE
# The Lock/Unlock mechanism on Unix is a manual, hand-coded implementation of PTHREAD_MUTEX_RECURSIVE.