HomePhabricator

refactor: Do not discard try_lock() return value

Description

refactor: Do not discard try_lock() return value

Summary:

Microsoft's C++ Standard Library uses the [[nodiscard]] attribute for try_lock().
See: https://github.com/microsoft/STL/blob/main/stl/inc/mutex

It appears the same issue occurs with GCC 13.1.

Backport of core#26189.

Test Plan:
With debug and GCC 13.1:

ninja all check-all

It should return no warning.

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D14005

Details

Provenance
Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>Authored on Aug 10 2022, 22:18
FabienCommitted on Jun 7 2023, 16:23
FabienPushed on Jun 7 2023, 16:23
Reviewer
Restricted Project
Differential Revision
D14005: refactor: Do not discard try_lock() return value
Parents
rABC13643e75537e: Add time helpers for std::chrono::steady_clock, Remove unused GetTimeSeconds
Branches
Unknown
Tags
Unknown

Event Timeline