Commit 55e8345c by Abseil Team Committed by Copybara-Service

absl: fix lint errors in Mutex

Currently linter warns on all changes:

missing #include <cstdlib> for 'std::atexit'

and

single-argument constructors must be marked explicit to avoid unintentional implicit conversions

Fix that.

PiperOrigin-RevId: 542135136
Change-Id: Ic86649de6baef7f2de71f45875bb66bd730bf6e1
parent 94d77fe3
......@@ -36,6 +36,7 @@
#include <algorithm>
#include <atomic>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <thread> // NOLINT(build/c++11)
......
......@@ -513,7 +513,7 @@ class ABSL_LOCKABLE Mutex {
base_internal::PerThreadSynch* w); // used for CondVar->Mutex transfer
// Catch the error of writing Mutex when intending MutexLock.
Mutex(const volatile Mutex* /*ignored*/) {} // NOLINT(runtime/explicit)
explicit Mutex(const volatile Mutex* /*ignored*/) {}
Mutex(const Mutex&) = delete;
Mutex& operator=(const Mutex&) = delete;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment