Under 1.33.1 we used to do this: boost::try_mutex::scoped_try_lock lock(m_mutex); if (lock.locked() && m_threadState == UploadMap) { I'm not sure, but I think under 1.37 I should do: boost::try_mutex::scoped_try_lock lock(m_mutex); if (lock.owns_lock() && m_threadState == UploadMap) { When I do that, I get a crash when I exit that I never used to have. Any ideas? Larry
"Larry E. Ramey"
Under 1.33.1 we used to do this:
boost::try_mutex::scoped_try_lock lock(m_mutex); if (lock.locked() && m_threadState == UploadMap) {
I'm not sure, but I think under 1.37 I should do:
boost::try_mutex::scoped_try_lock lock(m_mutex); if (lock.owns_lock() && m_threadState == UploadMap) {
That looks right.
When I do that, I get a crash when I exit that I never used to have.
What platform? Have you tried running a debugger? What else from boost are you using? There's quite a lot of changes in boost between 1.33.1 and 1.37. Anthony -- Author of C++ Concurrency in Action | http://www.manning.com/williams just::thread C++0x thread library | http://www.stdthread.co.uk Just Software Solutions Ltd | http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976
Thanks for responding. I'm running this on windows XP. I do run it in a debugger, for some reason it is having problems stepping into the boost code. And that should have been a big fat red flag. Some of my project dlls/sos were still linking with boost 1_33_1. Sigh. Its all good now. Thanks for confirming that ::locked() is now ::owns_lock() Larry
n I do that, I get a crash when I exit that I never used to have.
What platform? Have you tried running a debugger?
What else from boost are you using? There's quite a lot of changes in boost between 1.33.1 and 1.37.
Anthony
participants (2)
-
Anthony Williams
-
Larry E. Ramey