Remove uses of ATOMIC_VAR_INIT

ATOMIC_VAR_INIT has a trivial definition
`#define ATOMIC_VAR_INIT(value) (value)`,
is deprecated in C17/C++20, and will be removed in newer standards in
newer GCC/Clang (e.g. https://reviews.llvm.org/D144196).

PiperOrigin-RevId: 525534393
This commit is contained in:
MediaPipe Team 2023-04-19 13:24:47 -07:00 committed by Copybara-Service
parent 5bd3282515
commit 476c7efc18
2 changed files with 3 additions and 3 deletions

View File

@ -310,7 +310,7 @@ class Scheduler {
absl::Mutex state_mutex_;
// Current state of the scheduler.
std::atomic<State> state_ = ATOMIC_VAR_INIT(STATE_NOT_STARTED);
std::atomic<State> state_ = STATE_NOT_STARTED;
// True if all graph input streams are closed.
bool graph_input_streams_closed_ ABSL_GUARDED_BY(state_mutex_) = false;

View File

@ -454,8 +454,8 @@ class GlContext : public std::enable_shared_from_this<GlContext> {
// Number of glFinish calls completed on the GL thread.
// Changes should be guarded by mutex_. However, we use simple atomic
// loads for efficiency on the fast path.
std::atomic<int64_t> gl_finish_count_ = ATOMIC_VAR_INIT(0);
std::atomic<int64_t> gl_finish_count_target_ = ATOMIC_VAR_INIT(0);
std::atomic<int64_t> gl_finish_count_ = 0;
std::atomic<int64_t> gl_finish_count_target_ = 0;
GlContext* context_waiting_on_ ABSL_GUARDED_BY(mutex_) = nullptr;