Ticket #6674 (closed Bugs: fixed)

Opened 4 years ago

Last modified 4 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:


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


Change History

comment:1 Changed 4 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


Add a comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.