Commit 9a0d63ca authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

More constexpr in WaitOptions

Summary: [Folly] More `constexpr` in `WaitOptions`.

Reviewed By: magedm

Differential Revision: D13176175

fbshipit-source-id: 34f5300be29ba5903c9d9d2fb630d9f34ea094ac
parent d94318a5
...@@ -55,7 +55,7 @@ namespace folly { ...@@ -55,7 +55,7 @@ namespace folly {
template <bool MayBlock = true, template <typename> class Atom = std::atomic> template <bool MayBlock = true, template <typename> class Atom = std::atomic>
class Baton { class Baton {
public: public:
FOLLY_ALWAYS_INLINE static WaitOptions wait_options() { FOLLY_ALWAYS_INLINE static constexpr WaitOptions wait_options() {
return {}; return {};
} }
......
...@@ -127,7 +127,7 @@ class SaturatingSemaphore { ...@@ -127,7 +127,7 @@ class SaturatingSemaphore {
}; };
public: public:
FOLLY_ALWAYS_INLINE static WaitOptions wait_options() { FOLLY_ALWAYS_INLINE static constexpr WaitOptions wait_options() {
return {}; return {};
} }
......
...@@ -55,10 +55,10 @@ class WaitOptions { ...@@ -55,10 +55,10 @@ class WaitOptions {
std::chrono::microseconds(2); std::chrono::microseconds(2);
}; };
std::chrono::nanoseconds spin_max() const { constexpr std::chrono::nanoseconds spin_max() const {
return spin_max_; return spin_max_;
} }
WaitOptions& spin_max(std::chrono::nanoseconds dur) { constexpr WaitOptions& spin_max(std::chrono::nanoseconds dur) {
spin_max_ = dur; spin_max_ = dur;
return *this; return *this;
} }
......
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