|
Boost Users : |
Subject: Re: [Boost-users] Thread locks
From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2009-02-03 04:24:36
"Larry E. Ramey" <ramey_at_[hidden]> writes:
> 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
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net