Skip to content

Commit

Permalink
Merge #31: Use memory_order symbols consistently
Browse files Browse the repository at this point in the history
93ee8d8 Merge pull request google#965 from ShawnZhong:cpp20 (Victor Costan)

Pull request description:

  This is cherry-picked from upstream and can be dropped when upstream is fully synced to include the commit.

  For now this is needed for two reasons:

  * Consistently use the same symbol names in the whole project.
  * Compiling with C++20 fails.

ACKs for top commit:
  achow101:
    ACK 93ee8d8

Tree-SHA512: 3ab48f003cd01ff9dce2da8d68085fa5ff100c3e6de75a0a4b4dd1b669d78577c85d7663906441a410d8c96965fc059a574ff6ef9b2741f9a49bd31d65acb896
  • Loading branch information
fanquake committed Mar 2, 2022
2 parents f8ae182 + 93ee8d8 commit 330dd62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions util/env_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ class SingletonEnv {
public:
SingletonEnv() {
#if !defined(NDEBUG)
env_initialized_.store(true, std::memory_order::memory_order_relaxed);
env_initialized_.store(true, std::memory_order_relaxed);
#endif // !defined(NDEBUG)
static_assert(sizeof(env_storage_) >= sizeof(EnvType),
"env_storage_ will not fit the Env");
Expand All @@ -867,7 +867,7 @@ class SingletonEnv {

static void AssertEnvNotInitialized() {
#if !defined(NDEBUG)
assert(!env_initialized_.load(std::memory_order::memory_order_relaxed));
assert(!env_initialized_.load(std::memory_order_relaxed));
#endif // !defined(NDEBUG)
}

Expand Down
4 changes: 2 additions & 2 deletions util/env_windows.cc
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ class SingletonEnv {
public:
SingletonEnv() {
#if !defined(NDEBUG)
env_initialized_.store(true, std::memory_order::memory_order_relaxed);
env_initialized_.store(true, std::memory_order_relaxed);
#endif // !defined(NDEBUG)
static_assert(sizeof(env_storage_) >= sizeof(EnvType),
"env_storage_ will not fit the Env");
Expand All @@ -815,7 +815,7 @@ class SingletonEnv {

static void AssertEnvNotInitialized() {
#if !defined(NDEBUG)
assert(!env_initialized_.load(std::memory_order::memory_order_relaxed));
assert(!env_initialized_.load(std::memory_order_relaxed));
#endif // !defined(NDEBUG)
}

Expand Down

0 comments on commit 330dd62

Please sign in to comment.