Skip to content

Commit

Permalink
Merge pull request #15001 from chardan/jfw-wip-halflife_atomic_t-kama…
Browse files Browse the repository at this point in the history
…kuras

rgw: migrate atomic_t to std::atomic<>

Reviewed-by: Casey Bodley <cbodley@redhat.com>
  • Loading branch information
cbodley committed May 19, 2017
2 parents aa16248 + ec4f4c8 commit e546f46
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/rgw/rgw_loadgen_process.cc
Expand Up @@ -39,7 +39,7 @@ void RGWLoadGenProcess::run()

vector<string> buckets(num_buckets);

std::atomic<long int> failed = { 0 };
std::atomic<bool> failed = { false };

for (i = 0; i < num_buckets; i++) {
buckets[i] = "/loadgen";
Expand Down Expand Up @@ -104,7 +104,7 @@ void RGWLoadGenProcess::run()

void RGWLoadGenProcess::gen_request(const string& method,
const string& resource,
int content_length, std::atomic<long int>* fail_flag)
int content_length, std::atomic<bool>* fail_flag)
{
RGWLoadGenRequest* req =
new RGWLoadGenRequest(store->get_new_req_id(), method, resource,
Expand Down
10 changes: 4 additions & 6 deletions src/rgw/rgw_object_expirer_core.h
Expand Up @@ -4,11 +4,11 @@
#ifndef CEPH_OBJEXP_H
#define CEPH_OBJEXP_H

#include <errno.h>
#include <iostream>
#include <sstream>
#include <string>
#include <atomic>
#include <string>
#include <cerrno>
#include <sstream>
#include <iostream>

#include "auth/Crypto.h"

Expand Down Expand Up @@ -38,8 +38,6 @@
#include "rgw_usage.h"
#include "rgw_replica_log.h"

#include <atomic>

class RGWObjectExpirer {
protected:
RGWRados *store;
Expand Down
2 changes: 1 addition & 1 deletion src/rgw/rgw_process.h
Expand Up @@ -184,7 +184,7 @@ class RGWLoadGenProcess : public RGWProcess {
void checkpoint();
void handle_request(RGWRequest* req) override;
void gen_request(const string& method, const string& resource,
int content_length, std::atomic<int64_t>* fail_flag);
int content_length, std::atomic<bool>* fail_flag);

void set_access_key(RGWAccessKey& key) { access_key = key; }
};
Expand Down
4 changes: 2 additions & 2 deletions src/rgw/rgw_request.h
Expand Up @@ -59,10 +59,10 @@ struct RGWLoadGenRequest : public RGWRequest {
string method;
string resource;
int content_length;
std::atomic<int64_t>* fail_flag = nullptr;
std::atomic<bool>* fail_flag = nullptr;

RGWLoadGenRequest(uint64_t req_id, const string& _m, const string& _r, int _cl,
std::atomic<int64_t> *ff)
std::atomic<bool> *ff)
: RGWRequest(req_id), method(_m), resource(_r), content_length(_cl),
fail_flag(ff) {}
};
Expand Down

0 comments on commit e546f46

Please sign in to comment.