Commit 8cfc7d7f authored by Doron Roberts-Kedes's avatar Doron Roberts-Kedes Committed by Facebook Github Bot

DeterministicSchedule: Make the data_ field of Deterministic Atomic come from...

DeterministicSchedule: Make the data_ field of Deterministic Atomic come from a class template param.

Summary: see title.

Reviewed By: yfeldblum

Differential Revision: D10467678

fbshipit-source-id: b407cfa3c0cd1100b1f8f01ff8f2fee1f2a99ecb
parent cda0ac8f
...@@ -222,7 +222,10 @@ class DeterministicSchedule : boost::noncopyable { ...@@ -222,7 +222,10 @@ class DeterministicSchedule : boost::noncopyable {
* DeterministicAtomic<T> is a drop-in replacement std::atomic<T> that * DeterministicAtomic<T> is a drop-in replacement std::atomic<T> that
* cooperates with DeterministicSchedule. * cooperates with DeterministicSchedule.
*/ */
template <typename T, typename Schedule = DeterministicSchedule> template <
typename T,
typename Schedule = DeterministicSchedule,
template <typename> class Atom = std::atomic>
struct DeterministicAtomicImpl { struct DeterministicAtomicImpl {
DeterministicAtomicImpl() = default; DeterministicAtomicImpl() = default;
~DeterministicAtomicImpl() = default; ~DeterministicAtomicImpl() = default;
...@@ -448,7 +451,7 @@ struct DeterministicAtomicImpl { ...@@ -448,7 +451,7 @@ struct DeterministicAtomicImpl {
} }
private: private:
std::atomic<T> data_; Atom<T> data_;
}; };
template <typename T> template <typename T>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment