From: Yedidya Feldblum Date: Sat, 28 Oct 2017 18:31:23 +0000 (-0700) Subject: Move folly/detail/AtomicUtils.h X-Git-Tag: v2017.10.30.00~7 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=e89f46cd508ae85a0d0917119f5a73651e9af1b2 Move folly/detail/AtomicUtils.h Summary: [Folly] Move `folly/detail/AtomicUtils.h` to `folly/synchronization/detail/`. Reviewed By: Orvid Differential Revision: D6180482 fbshipit-source-id: 5671c149a59eea824db2935ffabcf85a2f78b690 --- diff --git a/folly/AtomicStruct.h b/folly/AtomicStruct.h index e3297604..a774d315 100644 --- a/folly/AtomicStruct.h +++ b/folly/AtomicStruct.h @@ -17,7 +17,7 @@ #pragma once #include -#include +#include #include #include #include diff --git a/folly/Makefile.am b/folly/Makefile.am index bb515379..f2b89b7e 100644 --- a/folly/Makefile.am +++ b/folly/Makefile.am @@ -67,7 +67,6 @@ nobase_follyinclude_HEADERS = \ ConstexprMath.h \ detail/AtomicHashUtils.h \ detail/AtomicUnorderedMapUtils.h \ - detail/AtomicUtils.h \ detail/BitIteratorDetail.h \ detail/DiscriminatedPtrDetail.h \ detail/FileUtilDetail.h \ @@ -418,6 +417,7 @@ nobase_follyinclude_HEADERS = \ stats/TimeseriesHistogram-defs.h \ stats/TimeseriesHistogram.h \ synchronization/CallOnce.h \ + synchronization/detail/AtomicUtils.h \ system/MemoryMapping.h \ system/Shell.h \ system/ThreadId.h \ diff --git a/folly/concurrency/AtomicSharedPtr.h b/folly/concurrency/AtomicSharedPtr.h index bd400d3c..d1b2aa7a 100644 --- a/folly/concurrency/AtomicSharedPtr.h +++ b/folly/concurrency/AtomicSharedPtr.h @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/folly/detail/AtomicUtils.h b/folly/detail/AtomicUtils.h deleted file mode 100644 index ff6a85ea..00000000 --- a/folly/detail/AtomicUtils.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2017 Facebook, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -namespace folly { -namespace detail { - -inline std::memory_order default_failure_memory_order( - std::memory_order successMode) { - switch (successMode) { - case std::memory_order_acq_rel: - return std::memory_order_acquire; - case std::memory_order_release: - return std::memory_order_relaxed; - default: - return successMode; - } -} -} // namespace detail -} // namespace folly diff --git a/folly/synchronization/detail/AtomicUtils.h b/folly/synchronization/detail/AtomicUtils.h new file mode 100644 index 00000000..ff6a85ea --- /dev/null +++ b/folly/synchronization/detail/AtomicUtils.h @@ -0,0 +1,36 @@ +/* + * Copyright 2017 Facebook, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +namespace folly { +namespace detail { + +inline std::memory_order default_failure_memory_order( + std::memory_order successMode) { + switch (successMode) { + case std::memory_order_acq_rel: + return std::memory_order_acquire; + case std::memory_order_release: + return std::memory_order_relaxed; + default: + return successMode; + } +} +} // namespace detail +} // namespace folly diff --git a/folly/test/DeterministicSchedule.h b/folly/test/DeterministicSchedule.h index 0f243d36..d085dcb0 100644 --- a/folly/test/DeterministicSchedule.h +++ b/folly/test/DeterministicSchedule.h @@ -29,9 +29,9 @@ #include #include -#include #include #include +#include namespace folly { namespace test {