Use std::atomic<bool> instead of folly::once_flag in folly::detail::MemoryIdler
Summary: Trying to use `ZeroSizeMutex` in `CallOnce.h` causes a circular dependency: ``` //folly/synchronization:call_once -> //folly/synchronization:call_once-module -> //folly/synchronization:call_once-module-helper -> //folly/synchronization:zero_size_mutex -> //folly/synchronization:baton -> //folly/detail:memory_idler -> //folly/synchronization:call_once ``` The benefits of `folly::once_flag` are as follows: https://www.internalfb.com/intern/diffusion/FBS/browse/master/fbcode/folly/synchronization/CallOnce.h?commit=d0211e9462c39c4655a7d2ff9d313f6fb433d74a&lines=37-42 A fast path is not necessary here because it's just logging within an error case. Exception-proof behavior is not needed because glog does not throw. Reviewed By: yfeldblum, andriigrynenko Differential Revision: D25797067 fbshipit-source-id: 4de20235ff4115b73ab8a2689e7697fc9fe4ba65
Showing
Please register or sign in to comment