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

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
This commit is contained in:
synqa
2026-02-19 17:44:38 +09:00
parent cfe854b339
commit 93bf90ba95

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;