Created on 2010-08-25.00:00:00 last changed 94 months ago
[ 2017-03-01, Kona ]
SG1 recommends: Close as NAD
Several participants voiced strong objections, based on either memory model issues or lock elision. No support. It is already possible to write a wrapper that explicitly tracks ownership for testing in the owning thread, which may have been part of the intent here.[ 2010 Batavia ]
The Concurrency subgroup reviewed this issue and deemed it to be an extension to be handled after publishing C++0x.
The LWG does not wish to make a change at this time.
[ Resolution proposed by ballot comment: ]
Add a member function:
bool is_locked() const;to std::mutex and std::recursive_mutex. These functions return true if the current thread would not be able to obtain a mutex. These functions do not synchronize with anything (and, thus, can avoid a memory fence).
Addresses US-189
mutex and recursive_mutex should have an is_locked() member function. is_locked allows a user to test a lock without acquiring it and can be used to implement a lightweight try_try_lock.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-03-01 18:09:34 | admin | set | messages: + msg9028 |
2014-11-24 15:11:58 | admin | set | status: nad future -> lewg |
2010-11-18 00:17:44 | admin | set | messages: + msg5379 |
2010-11-18 00:17:44 | admin | set | status: open -> nad future |
2010-10-24 16:08:33 | admin | set | messages: + msg5034 |
2010-08-25 00:00:00 | admin | create |