UniqueMutex for explicit ordering with ScopedSslBio
The MUTEX_LOCK / MUTEX_UNLOCK semantics work if you also explicitly
clear out resources that were supposed to be cleared before the lock is
released. However, with wrapper classes that do it automatically, you
can't get the correct ordering. Instead of converting these all to
manual acquire and release, convert the mutex handling to use automatic
release via UniqueMutex so that ordering is correct with resources that
should be protected by the mutex.
Thanks to Zhen Song for finding these issues.
1 file changed