Opened 11 years ago
Closed 11 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))
{
Note:
See TracTickets
for help on using tickets.

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