New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: migrate atomic_t to std::atomic<> (ebirah) #14839

Merged
merged 1 commit into from May 1, 2017

Conversation

Projects
None yet
2 participants
@chardan
Contributor

chardan commented Apr 27, 2017

Refer-to: #14655

This should contain all RGW changes (it's possible that there are minor patches elsewhere, but this will certainly be the bulk of them).

Signed-off-by: Jesse Williamson jwilliamson@suse.de

@@ -542,7 +544,7 @@ class RGWCoroutinesManager {
int run(list<RGWCoroutinesStack *>& ops);
int run(RGWCoroutine *op);
void stop() {
if (going_down.inc() == 1) {
if (!going_down) {

This comment has been minimized.

@cbodley

cbodley Apr 28, 2017

Contributor

the inc() here was important, allowing stop() to be called multiple times, but only calling completion_mgr->go_down() the first time

you -could- turn it back into an atomic<unsigned> and use if (++going_down == 1), but i think compare_exchange is a better fit for this:

bool expected = false;
if (going_down.compare_exchange_strong(expected, true)) {
  completion_mgr->go_down();
}

This comment has been minimized.

@chardan

chardan Apr 28, 2017

Contributor

Good catch! Thank you. Patched.

rgw: migrate atomic_t to std::atomic<>
Signed-off-by: Jesse Williamson <jwilliamson@suse.de>
@cbodley

This comment has been minimized.

Contributor

cbodley commented May 1, 2017

after fix to RGWCoroutinesManager::stop(), passed rgw suite: http://pulpito.ceph.com/cbodley-2017-04-27_23:02:56-rgw-wip-cbodley-testing---basic-mira/

@cbodley

cbodley approved these changes May 1, 2017

@cbodley cbodley merged commit 1e0b919 into ceph:master May 1, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment