We explicitly avoided TryAcquireSRWLockExclusive() because of crashes. This
issue was caused by a MinGW-w64 bug (mingw-w64 fix
46f77afc). Using a newer
toolchain works fine.
While try_write_lock() obviously can fail, not supporting it is not really an
option, as some algorithms depend on occasionally successful calls. Certificate
caching in the certificate manager and the cred_set cache rely on successful
try_write_lock()ing.
METHOD(rwlock_t, try_write_lock, bool,
private_rwlock_t *this)
{
- /* TODO: causes random failures and segfaults. Bug? */
- return FALSE;
return TryAcquireSRWLockExclusive(&this->srw);
}