The easy solution I took was to look at the wxWidgets source code and see how they did it. They just mapped it to wxMutex on non-MSW, which does have TryEnter, so that mapped in perfectly.
I checked in all my backlog of changes to SVN, including the overhaul of CCriticalSection in util.h and OpenSSL’s mutex callback in util.cpp to do everything with wxWidgets when not on Windows.
If we get it working on Linux, I’ll run my test suite against it here off-network first, then we can give an unreleased build to LibertyStandard to test for a while before going public.
mmalmi@cc.hut.fi wrote:
I’ll convert the CriticalSection code to wxCriticalSection and upload it to SVN (it’s a little tricky). I don’t know what to do for TryEnterCriticalSection though. I think I’m almost ready to check everything in.
Would the Boost mutex be of any help here?
Source: Published by Martti Malmi on GitHub in February 2024 as part of his testimony in the COPA v. Wright trial. The full correspondence archive is available at mmalmi.github.io/satoshi/.