Fwd: boost::unique_lock throw a exception
I use boost1.52 on windows2003sp2, boost::unique_lock throw a exception, please help me. stack is: *RaiseException_CxxThrowExceptionboost::throw_exceptionboost::lock_error[e:\library\boost_1_52\boost\throw_exception.hpp:67] boost::shared_mutex::timed_lock[e:\library\boost_1_52\boost\thread\win32\shared_mutex.hpp:430]boost::shared_mutex::lock[e:\library\boost_1_52\boost\thread\win32\shared_mutex.hpp:382]boost::unique_lockboost::shared_mutex::lock[e:\library\boost_1_52\boost\thread\locks.hpp:510]* ------------------------------------------------------------------------ *bool timed_lock(boost::system_time const& wait_until){ for(;;) { state_data old_state=state; for(;;) { state_data new_state=old_state; if(new_state.shared_count || new_state.exclusive) { ++new_state.exclusive_waiting; if(!new_state.exclusive_waiting) { boost::throw_exception(boost::lock_error()); } new_state.exclusive_waiting_blocked=true; } else { new_state.exclusive=true; }*
I use boost1.52 on windows2003sp2, boost::unique_lock throw a exception, please help me.
stack is: RaiseException _CxxThrowException boost::throw_exceptionboost::lock_error[e:\library\boost_1_52\boost\throw_exception.hpp:67] boost::shared_mutex::timed_lock[e:\library\boost_1_52\boost\thread\win32\shared_mutex.hpp:430] boost::shared_mutex::lock[e:\library\boost_1_52\boost\thread\win32\shared_mutex.hpp:382] boost::unique_lockboost::shared_mutex::lock[e:\library\boost_1_52\boost\thread\locks.hpp:510]
Do you lock or unlock the mutex twice?
I have review my code, not lock or unlock twice.
2014-02-13 17:44 GMT+08:00 Igor R
I use boost1.52 on windows2003sp2, boost::unique_lock throw a exception, please help me.
stack is: RaiseException _CxxThrowException
boost::throw_exceptionboost::lock_error[e:\library\boost_1_52\boost\throw_exception.hpp:67]
boost::shared_mutex::timed_lock[e:\library\boost_1_52\boost\thread\win32\shared_mutex.hpp:430]
boost::shared_mutex::lock[e:\library\boost_1_52\boost\thread\win32\shared_mutex.hpp:382]
boost::unique_lockboost::shared_mutex::lock[e:\library\boost_1_52\boost\thread\locks.hpp:510]
Do you lock or unlock the mutex twice? _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
2014-02-13 17:44 GMT+08:00 Igor R
: I use boost1.52 on windows2003sp2, boost::unique_lock throw a exception, please help me.
stack is: RaiseException _CxxThrowException
boost::throw_exceptionboost::lock_error[e:\library\boost_1_52\boost\throw_exception.hpp:67]
boost::shared_mutex::timed_lock[e:\library\boost_1_52\boost\thread\win32\shared_mutex.hpp:430]
boost::shared_mutex::lock[e:\library\boost_1_52\boost\thread\win32\shared_mutex.hpp:382]
boost::unique_lockboost::shared_mutex::lock[e:\library\boost_1_52\boost\thread\locks.hpp:510]
Do you lock or unlock the mutex twice?
On Thu, Feb 13, 2014 at 10:29:54PM +0800, shada wrote:
I have review my code, not lock or unlock twice.
That's nice that you feel that way. Without a reasonably small test case or at a minimum relevant snippets, I don't see what you intend for the list to do with your problem. Try to condense your faulting application to a small self-contained test case that still demonstrates the problem. Also consult the documentation for Boost.Thread so you know what this exception means and what constraints you have on the locking and unlocking of lockable objects. Finally, on these lists when you reply you should write your response below the part you're reponding to or at the very least at the end of the mail. Have a nice day, -- Lars Viklund | zao@acc.umu.se
participants (3)
-
Igor R
-
Lars Viklund
-
shada