__throw_system_error(__e);
}
+ _GLIBCXX_NODISCARD
bool
try_lock() noexcept
{
}
}
+ _GLIBCXX_NODISCARD
bool
try_lock()
{
}
template<typename _Clock, typename _Duration>
+ _GLIBCXX_NODISCARD
bool
try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
{
}
template<typename _Rep, typename _Period>
+ _GLIBCXX_NODISCARD
bool
try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
{
return __ret;
}
+ _GLIBCXX_NODISCARD
bool
owns_lock() const noexcept
{ return _M_owns; }
explicit operator bool() const noexcept
{ return owns_lock(); }
+ _GLIBCXX_NODISCARD
mutex_type*
mutex() const noexcept
{ return _M_device; }
__throw_system_error(__e);
}
+ _GLIBCXX_NODISCARD
bool
try_lock() noexcept
{
__throw_system_error(__e);
}
+ _GLIBCXX_NODISCARD
bool
try_lock() noexcept
{
}
template <class _Rep, class _Period>
+ _GLIBCXX_NODISCARD
bool
try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
{ return _M_try_lock_for(__rtime); }
template <class _Clock, class _Duration>
+ _GLIBCXX_NODISCARD
bool
try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
{ return _M_try_lock_until(__atime); }
__throw_system_error(__e);
}
+ _GLIBCXX_NODISCARD
bool
try_lock() noexcept
{
}
template <class _Rep, class _Period>
+ _GLIBCXX_NODISCARD
bool
try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
{ return _M_try_lock_for(__rtime); }
template <class _Clock, class _Duration>
+ _GLIBCXX_NODISCARD
bool
try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
{ return _M_try_lock_until(__atime); }
_M_locked = true;
}
+ _GLIBCXX_NODISCARD
bool
try_lock()
{
}
template<typename _Rep, typename _Period>
+ _GLIBCXX_NODISCARD
bool
try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
{
}
template<typename _Clock, typename _Duration>
+ _GLIBCXX_NODISCARD
bool
try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
{
++_M_count;
}
+ _GLIBCXX_NODISCARD
bool
try_lock()
{
}
template<typename _Rep, typename _Period>
+ _GLIBCXX_NODISCARD
bool
try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
{
}
template<typename _Clock, typename _Duration>
+ _GLIBCXX_NODISCARD
bool
try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
{
* Sequentially calls try_lock() on each argument.
*/
template<typename _L1, typename _L2, typename... _L3>
+ _GLIBCXX_NODISCARD
inline int
try_lock(_L1& __l1, _L2& __l2, _L3&... __l3)
{
// Exclusive ownership
void lock() { _M_impl.lock(); }
- bool try_lock() { return _M_impl.try_lock(); }
+ [[nodiscard]] bool try_lock() { return _M_impl.try_lock(); }
void unlock() { _M_impl.unlock(); }
// Shared ownership
void lock_shared() { _M_impl.lock_shared(); }
- bool try_lock_shared() { return _M_impl.try_lock_shared(); }
+ [[nodiscard]] bool try_lock_shared() { return _M_impl.try_lock_shared(); }
void unlock_shared() { _M_impl.unlock_shared(); }
#if _GLIBCXX_USE_PTHREAD_RWLOCK_T
// Exclusive ownership
void lock() { _Base::lock(); }
- bool try_lock() { return _Base::try_lock(); }
+ _GLIBCXX_NODISCARD bool try_lock() { return _Base::try_lock(); }
void unlock() { _Base::unlock(); }
template<typename _Rep, typename _Period>
+ _GLIBCXX_NODISCARD
bool
try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
{
// Shared ownership
void lock_shared() { _Base::lock_shared(); }
+ _GLIBCXX_NODISCARD
bool try_lock_shared() { return _Base::try_lock_shared(); }
void unlock_shared() { _Base::unlock_shared(); }
template<typename _Rep, typename _Period>
+ _GLIBCXX_NODISCARD
bool
try_lock_shared_for(const chrono::duration<_Rep, _Period>& __rtime)
{
// Exclusive ownership
template<typename _Duration>
+ _GLIBCXX_NODISCARD
bool
try_lock_until(const chrono::time_point<chrono::system_clock,
_Duration>& __atime)
#ifdef _GLIBCXX_USE_PTHREAD_RWLOCK_CLOCKLOCK
template<typename _Duration>
+ _GLIBCXX_NODISCARD
bool
try_lock_until(const chrono::time_point<chrono::steady_clock,
_Duration>& __atime)
#endif
template<typename _Clock, typename _Duration>
+ _GLIBCXX_NODISCARD
bool
try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
{
// Shared ownership
template<typename _Duration>
+ _GLIBCXX_NODISCARD
bool
try_lock_shared_until(const chrono::time_point<chrono::system_clock,
_Duration>& __atime)
#ifdef _GLIBCXX_USE_PTHREAD_RWLOCK_CLOCKLOCK
template<typename _Duration>
+ _GLIBCXX_NODISCARD
bool
try_lock_shared_until(const chrono::time_point<chrono::steady_clock,
_Duration>& __atime)
#endif
template<typename _Clock, typename _Duration>
+ _GLIBCXX_NODISCARD
bool
try_lock_shared_until(const chrono::time_point<_Clock,
_Duration>& __atime)
// Exclusive ownership
template<typename _Clock, typename _Duration>
+ _GLIBCXX_NODISCARD
bool
try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time)
{
// Shared ownership
template <typename _Clock, typename _Duration>
+ _GLIBCXX_NODISCARD
bool
try_lock_shared_until(const chrono::time_point<_Clock,
_Duration>& __abs_time)
_M_owns = true;
}
+ _GLIBCXX_NODISCARD
bool
try_lock()
{
}
template<typename _Rep, typename _Period>
+ _GLIBCXX_NODISCARD
bool
try_lock_for(const chrono::duration<_Rep, _Period>& __rel_time)
{
}
template<typename _Clock, typename _Duration>
+ _GLIBCXX_NODISCARD
bool
try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time)
{
// Getters
+ _GLIBCXX_NODISCARD
bool owns_lock() const noexcept { return _M_owns; }
explicit operator bool() const noexcept { return _M_owns; }
+ _GLIBCXX_NODISCARD
mutex_type* mutex() const noexcept { return _M_pm; }
private:
test01()
{
std::recursive_timed_mutex m;
- m.try_lock_until(clok::now()); // { dg-error "here" }
+ (void) m.try_lock_until(clok::now()); // { dg-error "here" }
}
struct cloc
test02()
{
std::recursive_timed_mutex m;
- m.try_lock_until(cloc::now()); // { dg-error "here" }
+ (void) m.try_lock_until(cloc::now()); // { dg-error "here" }
}
// { dg-error "static assertion failed" "" { target *-*-* } 0 }
try
{
- l.try_lock_for(std::chrono::milliseconds(100));
+ (void) l.try_lock_for(std::chrono::milliseconds(100));
}
catch(const std::system_error&)
{
try
{
- l.try_lock_until(t);
+ (void) l.try_lock_until(t);
}
catch(const std::system_error&)
{
{
std::shared_timed_mutex m;
std::shared_lock<std::shared_timed_mutex> l(m, std::defer_lock);
- l.try_lock_until(clok::now()); // { dg-error "here" }
+ (void) l.try_lock_until(clok::now()); // { dg-error "here" }
}
struct cloc
{
std::shared_timed_mutex m;
std::shared_lock<std::shared_timed_mutex> l(m, std::defer_lock);
- l.try_lock_until(cloc::now()); // { dg-error "here" }
+ (void) l.try_lock_until(cloc::now()); // { dg-error "here" }
}
// { dg-error "static assertion failed" "" { target *-*-* } 0 }
test01()
{
std::shared_timed_mutex m;
- m.try_lock_until(clok::now()); // { dg-error "here" }
+ (void) m.try_lock_until(clok::now()); // { dg-error "here" }
}
struct cloc
test02()
{
std::shared_timed_mutex m;
- m.try_lock_shared_until(cloc::now()); // { dg-error "here" }
+ (void) m.try_lock_shared_until(cloc::now()); // { dg-error "here" }
}
// { dg-error "static assertion failed" "" { target *-*-* } 0 }
test01()
{
std::timed_mutex m;
- m.try_lock_until(clok::now()); // { dg-error "here" }
+ (void) m.try_lock_until(clok::now()); // { dg-error "here" }
}
struct cloc
test02()
{
std::timed_mutex m;
- m.try_lock_until(cloc::now()); // { dg-error "here" }
+ (void) m.try_lock_until(cloc::now()); // { dg-error "here" }
}
// { dg-error "static assertion failed" "" { target *-*-* } 0 }
unreliable_lock::count = 0;
try
{
- std::try_lock(l1, l2, l3);
+ (void) std::try_lock(l1, l2, l3);
VERIFY( false );
}
catch (int e)
void test03()
{
test_type l1, l2, l3;
- std::try_lock(l1, l2, l3);
+ (void) std::try_lock(l1, l2, l3);
}
try
{
- l.try_lock_for(std::chrono::milliseconds(100));
+ (void) l.try_lock_for(std::chrono::milliseconds(100));
}
catch(const std::system_error&)
{
{
std::timed_mutex m;
std::unique_lock<std::timed_mutex> l(m, std::defer_lock);
- l.try_lock_until(clok::now()); // { dg-error "here" }
+ (void) l.try_lock_until(clok::now()); // { dg-error "here" }
}
struct cloc
{
std::recursive_timed_mutex m;
std::unique_lock<std::recursive_timed_mutex> l(m, std::defer_lock);
- l.try_lock_until(cloc::now()); // { dg-error "here" }
+ (void) l.try_lock_until(cloc::now()); // { dg-error "here" }
}
// { dg-error "static assertion failed" "" { target *-*-* } 0 }