From: Adam C. Emerson Date: Wed, 9 Nov 2016 21:07:32 +0000 (-0500) Subject: rbd: Initialize std::atomic flag with an equals sign X-Git-Tag: v11.1.0~241^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cfa27624d95c8ea3a732bc75cd31c97515b6a9cd;p=ceph.git 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 --- diff --git a/src/librbd/operation/ObjectMapIterate.h b/src/librbd/operation/ObjectMapIterate.h index cc2dc3432f78..030df69d54d1 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();