]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: rgw_rados: s/atomic_t/atomic<>/
authorKefu Chai <kchai@redhat.com>
Thu, 8 Jun 2017 03:32:02 +0000 (11:32 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 8 Jun 2017 03:46:26 +0000 (11:46 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/rgw/rgw_rados.cc

index 88f198d3ce8b0ca3343ac6745e32fc3a530c5bbb..74061eeb212bfaec9cfa4c0216c6185baf0a0b5e 100644 (file)
@@ -72,8 +72,6 @@ using namespace librados;
 
 #include "compressor/Compressor.h"
 
-#include <atomic>
-
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_rgw
 
@@ -3488,7 +3486,7 @@ class RGWIndexCompletionManager {
 
   int num_shards;
 
-  atomic_t cur_shard;
+  std::atomic<int> cur_shard;
 
 
 public:
@@ -3512,8 +3510,8 @@ public:
   }
 
   int next_shard() {
-    int result = cur_shard.read() % num_shards;
-    cur_shard.inc();
+    int result = cur_shard % num_shards;
+    cur_shard++;
     return result;
   }