|
Boost : |
Subject: Re: [boost] [thread] Assertion failed get_system_time_sentinel()
From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2009-03-30 06:28:06
Filip Klasson <filkl784_at_[hidden]> writes:
> Hi,
>
> I get Assertion failed
> timed_lock(::boost::detail::get_system_time_sentinel()), file
> c:\boost\thread\win32\basic_timed_mutex.hpp, line 64.
>
> Code in basic_timed_mutex.hpp:
> void lock()
> {
>
> BOOST_VERIFY(timed_lock(::boost::detail::get_system_time_sentinel()));
> //Line 64
> }
That really is bizarre. Can you show a minimal example that demonstrates
the problem?
> Here is my code, i have marked where Assertion failed happends.
>
> boost::mutex::scoped_lock lock(_mutex);
> while(_queue.empty()) {
> _condition.wait(lock);
> } //Assertion failed happends here.
> //Another thread is signaling the condition variable when an element is
> added to the _queue.
What is the lifetime of the various elements _mutex, _condition and
_queue? Is it possible that they have been destroyed by another thread?
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 list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk