SN-10080 附来源、原文与上下文。
我采取了一个简单办法:看 wxWidgets 的源代码,看看他们怎么做。他们在非 MSW 平台上直接把它映射到 wxMutex,而 wxMutex 确实有 TryEnter,所以能完全对应上。
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.
我把积累的所有改动都提交到了 SVN,包括重写 util.h 中的 CCriticalSection,以及 util.cpp 中 OpenSSL 的互斥锁回调,以便在非 Windows 平台上全部通过 wxWidgets 实现。
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.
如果我们让它在 Linux 上运行起来,我会先在这里离线跑一遍测试套件,然后可以把一个未发布的构建版交给 LibertyStandard 测试一段时间,再公开发布。
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.
引用 Martti Malmi 的文字Martti Malmi来源 ↗引用中本聪此前的文字中本聪来源 ↗我会把 CriticalSection 代码改成 wxCriticalSection,再上传到 SVN(有点棘手)。不过,我还不知道 TryEnterCriticalSection 该怎么办。我想自己差不多准备好把所有内容提交上去了。
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.
Boost 的互斥锁在这里会有帮助吗?
Would the Boost mutex be of any help here?