Re: [Boost-bugs] [Boost C++ Libraries] #9856: [windows] condition_variable::wait_for returns wrong cv_status on timeout.

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9856: [windows] condition_variable::wait_for returns wrong cv_status on timeout.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-01-10 13:13:59


#9856: [windows] condition_variable::wait_for returns wrong cv_status on timeout.
-------------------------+-------------------------------------------------
  Reporter: pi88el@… | Owner: viboes
      Type: Bugs | Status: reopened
 Milestone: | Component: thread
   Version: Boost | Severity: Problem
  1.57.0 | Keywords: condition_variable wait_for
Resolution: | cv_status
-------------------------+-------------------------------------------------

Comment (by ned14):

 I've put together the following test case test_9856.cpp:


 {{{
 #include "boost/thread.hpp"
 #include <iostream>

 using namespace boost;

 int main() {
     mutex mtx;
     condition_variable cond;

     unique_lock<mutex> lk(mtx);

     std::cout << BOOST_VERSION << "\n";

     for(int i=0; i<10; i++) {
         //std::cout << i << " : " << chrono::steady_clock::now().count()
 << "\n";
         if (cv_status::timeout != cond.wait_for(lk, chrono::seconds(1)))
         {
             std::cout << "ERROR: Wrong return code!\n";
             return 1;
         }
     }
     return 0;
 }

 }}}

 I'll test it on Windows when I reboot out of Linux later today. I've also
 lined up a KVM virtualised Windows to test upon.

 Niall

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9856#comment:13>
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:17 UTC