threading: Support rwlock try_write_lock() on Windows
authorMartin Willi <martin@revosec.ch>
Wed, 22 Oct 2014 09:24:51 +0000 (11:24 +0200)
committerMartin Willi <martin@revosec.ch>
Thu, 30 Oct 2014 09:45:24 +0000 (10:45 +0100)
commit61e29aca0dcc3e706a97d3b95d988b65723535a5
tree2e2be902167fcec0f65a523e42c9fc343e6942b0
parent6a3f0467e48dfbced121ac9e1ac818de9b7292e1
threading: Support rwlock try_write_lock() on Windows

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.
src/libstrongswan/threading/windows/rwlock.c