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.
Quote from: mmalmi@cc.hut.fiI’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?
http://www.boost.org/doc/libs/1_40_0/doc/html/thread/synchronization.html#thread.synchronization.mutex_concepts