From cfa27624d95c8ea3a732bc75cd31c97515b6a9cd Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Wed, 9 Nov 2016 16:07:32 -0500 Subject: [PATCH] rbd: Initialize std::atomic flag with an equals sign I know it's weird, but std::atomic_flag f = ATOMIC_FLAG_INIT; is guaranteed to work, while std::atomic_flag g(ATOMIC_FLAG_INIT); is free to make demons fly out of your nose. Signed-off-by: Adam C. Emerson --- src/librbd/operation/ObjectMapIterate.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/librbd/operation/ObjectMapIterate.h b/src/librbd/operation/ObjectMapIterate.h index cc2dc3432f7..030df69d54d 100644 --- a/src/librbd/operation/ObjectMapIterate.h +++ b/src/librbd/operation/ObjectMapIterate.h @@ -30,8 +30,7 @@ public: ProgressContext &prog_ctx, ObjectIterateWork handle_mismatch) : AsyncRequest(image_ctx, on_finish), m_image_ctx(image_ctx), - m_prog_ctx(prog_ctx), m_handle_mismatch(handle_mismatch), - m_invalidate(ATOMIC_FLAG_INIT) + m_prog_ctx(prog_ctx), m_handle_mismatch(handle_mismatch) { } @@ -49,7 +48,7 @@ private: ImageCtxT &m_image_ctx; ProgressContext &m_prog_ctx; ObjectIterateWork m_handle_mismatch; - std::atomic_flag m_invalidate; + std::atomic_flag m_invalidate = ATOMIC_FLAG_INIT; State m_state; void send_verify_objects(); -- 2.39.5