From 25e200e22d254f860f693e347706f918aa4de9ab Mon Sep 17 00:00:00 2001 From: Brian Watling Date: Wed, 10 Dec 2014 11:04:28 -0800 Subject: [PATCH] Use an IO thread pool executor by default Summary: Remove member variable name shadowing Facebook: This diff adds a default executor for async requests which do not specify one. This ensures we don't run request callbacks on the event threads (which in turn ensures we don't make blocking tcc calls from the event threads) Test Plan: fbconfig tao/client; fbmake runtests Reviewed By: hannesr@fb.com Subscribers: hannesr, fugalh, zhuohuang, folly-diffs@, tao-eng@ FB internal diff: D1731078 Tasks: 5752037 Signature: t1:1731078:1418237801:5b9bbe74c288292d5e7c7e6a38e67be864627d89 --- folly/experimental/wangle/concurrent/LifoSemMPMCQueue.h | 2 +- folly/experimental/wangle/rx/Observable.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/folly/experimental/wangle/concurrent/LifoSemMPMCQueue.h b/folly/experimental/wangle/concurrent/LifoSemMPMCQueue.h index 45d362e9..ff499991 100644 --- a/folly/experimental/wangle/concurrent/LifoSemMPMCQueue.h +++ b/folly/experimental/wangle/concurrent/LifoSemMPMCQueue.h @@ -24,7 +24,7 @@ namespace folly { namespace wangle { template class LifoSemMPMCQueue : public BlockingQueue { public: - explicit LifoSemMPMCQueue(size_t capacity) : queue_(capacity) {} + explicit LifoSemMPMCQueue(size_t max_capacity) : queue_(max_capacity) {} void add(T item) override { if (!queue_.write(std::move(item))) { diff --git a/folly/experimental/wangle/rx/Observable.h b/folly/experimental/wangle/rx/Observable.h index c822bb71..cf75208d 100644 --- a/folly/experimental/wangle/rx/Observable.h +++ b/folly/experimental/wangle/rx/Observable.h @@ -151,7 +151,7 @@ class Observable { *inCallback_ = true; { - RWSpinLock::ReadHolder(observersLock_); + RWSpinLock::ReadHolder rh(observersLock_); for (auto o : observers_) { f(o); } @@ -165,7 +165,7 @@ class Observable { (newSubscribers_ && !newSubscribers_->empty()) || (oldSubscribers_ && !oldSubscribers_->empty()))) { { - RWSpinLock::WriteHolder(observersLock_); + RWSpinLock::WriteHolder wh(observersLock_); if (newObservers_) { for (auto observer : *(newObservers_)) { observers_.push_back(observer); -- 2.34.1