Re: [Boost-bugs] [Boost C++ Libraries] #9618: try_join_for problem: program is not terminate.

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9618: try_join_for problem: program is not terminate.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-02-03 12:25:21


#9618: try_join_for problem: program is not terminate.
---------------------------------+--------------------------
  Reporter: oniprog <tkuman@…> | Owner: viboes
      Type: Bugs | Status: assigned
 Milestone: To Be Determined | Component: thread
   Version: Boost 1.55.0 | Severity: Problem
Resolution: | Keywords: try_join_for
---------------------------------+--------------------------

Comment (by oniprog <tkuman@…>):

 I found that my program sometimes hang up even if
 "try_join_for(chrono::milliseconds(1))" uses in my environment...

 I found that rel_time sometimes become -1.... in my windows 8.1 64 bits
 environment.

 I modified the program.

 boost/thread/detail/thread.hpp

 {{{
         bool try_join_until(const chrono::time_point<chrono::system_clock,
 chrono::nanoseconds>& tp)
         {
           chrono::milliseconds rel_time= chrono::ceil<chrono::milliseconds
>(tp-chrono::system_clock::now());
           return do_try_join_until(rel_time.count());
         }
 }}}


 replace with


 {{{
         bool try_join_until(const chrono::time_point<chrono::system_clock,
 chrono::nanoseconds>& tp)
         {
           chrono::milliseconds rel_time= chrono::ceil<chrono::milliseconds
>(tp-chrono::system_clock::now());
                   if ( rel_time < chrono::milliseconds::zero()) //
 rel_time must not be minus.
                           rel_time= chrono::milliseconds::zero();
           return do_try_join_until(rel_time.count());
         }
 }}}


 I am not confident that this is OK because I don't have exact (academic)
 knowledge about thread.

 Is this modification OK?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9618#comment:9>
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:15 UTC