Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11562: (condition_variable_any::wait_until + recursive_mutex + steady_clock) timer expires after computer time is set forward on Ubuntu 64-bit
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-12-09 12:57:11
#11562: (condition_variable_any::wait_until + recursive_mutex + steady_clock) timer
expires after computer time is set forward on Ubuntu 64-bit
---------------------------+----------------------------------------
Reporter: boriss@⦠| Owner: viboes
Type: Bugs | Status: reopened
Milestone: Boost 1.60.0 | Component: thread
Version: Boost 1.59.0 | Severity: Showstopper
Resolution: | Keywords: steady_clock, Linux 64-bit
---------------------------+----------------------------------------
Changes (by boriss@â¦):
* status: closed => reopened
* resolution: fixed =>
Comment:
We have prepared small example where we have problem with
condition_variable_any:
.h file:
{{{
class ThreadsTest:public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(ThreadsTest);
CPPUNIT_TEST(testThreads);
CPPUNIT_TEST_SUITE_END();
public:
void setUp();
void tearDown();
void testThreads();
void runThread();
boost::recursive_mutex m_CsQueuedItems;
boost::condition_variable_any m_EvQueuedItems;
bool mIsInterrupted;
};
}}}
.cpp file:
{{{
void ThreadsTest::runThread()
{
while (!mIsInterrupted)
{
{
boost::recursive_mutex::scoped_lock _lock1(m_CsQueuedItems);
boost::chrono::time_point<boost::chrono::steady_clock>
untilTime(boost::chrono::steady_clock::now() +
boost::chrono::milliseconds(500));
m_EvQueuedItems.wait_until(_lock1, untilTime);
}
}
}
void ThreadsTest::testThreads()
{
mIsInterrupted=false;
{
boost::recursive_mutex::scoped_lock _lock1(m_CsQueuedItems);
boost::thread newThread(boost::bind(&ThreadsTest::runThread, this));
}
ThreadBase::Sleep(1000);
mIsInterrupted=true;
ThreadBase::Sleep(1000);
}
}}}
We used boost1.60.0 beta1, rc4 with added definition
BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC.
We got segmentation fault error.
testThreads() function is part of unit test and is called first.
Can you please check the example and let us know if you see any problem
with this code.
If there is no problem with our example, please try to fix the problem in
boost library.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11562#comment:46> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC