Opened 13 years ago
Closed 10 years ago
#3567 closed Feature Requests (fixed)
Request for shared_lock_guard
| Reported by: | Andrey Semashev | Owned by: | viboes |
|---|---|---|---|
| Milestone: | Boost 1.50.0 | Component: | thread |
| Version: | Boost 1.40.0 | Severity: | Not Applicable |
| Keywords: | lock_guard | Cc: | viboes |
Description
It would be nice to have a lighter alternative for the shared_lock template, similar to the lock_guard alternative for the unique_lock.
Attachments (1)
Change History (9)
comment:1 by , 13 years ago
comment:3 by , 13 years ago
| Cc: | added |
|---|---|
| Severity: | Optimization → Not Applicable |
| Type: | Feature Requests → Patches |
comment:4 by , 12 years ago
| Type: | Patches → Feature Requests |
|---|
Comeback to Feature request as the patch is not complete.
comment:5 by , 11 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:6 by , 11 years ago
| Milestone: | Boost 1.41.0 → Boost 1.50.0 |
|---|
by , 11 years ago
comment:8 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Committed in release branch at [78543]
Note:
See TracTickets
for help on using tickets.

Something like that?
template<typename Mutex> class shared_lock_guard { private: Mutex& m; explicit shared_lock_guard(shared_lock_guard&); shared_lock_guard& operator=(shared_lock_guard&); public: explicit shared_lock_guard(Mutex& m_): m(m_) { m.lock_shared(); } shared_lock_guard(Mutex& m_,adopt_lock_t): m(m_) {} ~shared_lock_guard() { m.unlock_shared(); } };