Modify

Opened 6 years ago

Closed 6 years ago

#6674 closed Bugs (fixed)

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 (0)

Change History (1)

comment:1 Changed 6 years ago by viboes

Resolution: fixed
Status: newclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain viboes.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.