]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: Initialize std::atomic flag with an equals sign
authorAdam C. Emerson <aemerson@redhat.com>
Wed, 9 Nov 2016 21:07:32 +0000 (16:07 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Thu, 17 Nov 2016 00:54:31 +0000 (19:54 -0500)
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 <aemerson@redhat.com>
src/librbd/operation/ObjectMapIterate.h

index cc2dc3432f78b99904c79e0f3c6934a7f1ab3cfd..030df69d54d191a6d565c7717e5cfd471e091523 100644 (file)
@@ -30,8 +30,7 @@ public:
                          ProgressContext &prog_ctx,
                          ObjectIterateWork<ImageCtxT> handle_mismatch)
     : AsyncRequest<ImageCtxT>(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<ImageCtxT> m_handle_mismatch;
-  std::atomic_flag m_invalidate;
+  std::atomic_flag m_invalidate = ATOMIC_FLAG_INIT;
   State m_state;
 
   void send_verify_objects();