Modify

Ticket #6674 (closed Bugs: fixed)

Opened 2 years ago

Last modified 2 years ago

shared_mutex: try_lock_upgrade_until doesn't works

Reported by: viboes Owned by: viboes
Milestone: To Be Determined Component: thread
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

There is a bug on the code of shared_mutex::try_lock_upgrade_until. The following change fixes it.

         template <class Clock, class Duration>
         bool try_lock_upgrade_until(const chrono::time_point<Clock, Duration>& abs_time)
           boost::mutex::scoped_lock lk(state_change);
           while(state.exclusive || state.exclusive_waiting_blocked || state.upgrade)
           {
-              if(cv_status::no_timeout == shared_cond.wait_until(lk,abs_time))
+              if(cv_status::timeout == shared_cond.wait_until(lk,abs_time))
               {

Attachments

Change History

comment:1 Changed 2 years ago by viboes

  • Status changed from new to closed
  • Resolution set to fixed

(In [77290]) Thread: Fix error on pthread/shared_mutex.hpp try_lock_xxx_for, which should use the try_lock_xxx_until+fix #6674

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.