From 042b0f2218f0bb12543e6d847fa13bc2a6c45467 Mon Sep 17 00:00:00 2001 From: Michael Lee Date: Fri, 31 Jul 2015 15:51:59 -0700 Subject: [PATCH] Not to use EventBaseLocal on mobile Summary: Temp remove EventBaseLocal on mobile. Reviewed By: @djwatson Differential Revision: D2302322 --- folly/io/async/EventBase.cpp | 2 ++ folly/io/async/EventBase.h | 4 ++++ folly/io/async/EventBaseLocal.cpp | 4 ++++ folly/io/async/EventBaseLocal.h | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/folly/io/async/EventBase.cpp b/folly/io/async/EventBase.cpp index 4fe704a1..1f23b2b6 100644 --- a/folly/io/async/EventBase.cpp +++ b/folly/io/async/EventBase.cpp @@ -239,12 +239,14 @@ EventBase::~EventBase() { event_base_free(evb_); } +#if !defined(ANDROID) && !defined(__ANDROID__) && !defined(__APPLE__) { std::lock_guard lock(localStorageMutex_); for (auto storage : localStorageToDtor_) { storage->onEventBaseDestruction(*this); } } +#endif VLOG(5) << "EventBase(): Destroyed."; } diff --git a/folly/io/async/EventBase.h b/folly/io/async/EventBase.h index 41bf0aea..e15465c9 100644 --- a/folly/io/async/EventBase.h +++ b/folly/io/async/EventBase.h @@ -47,11 +47,13 @@ typedef std::function Cob; template class NotificationQueue; +#if !defined(ANDROID) && !defined(__ANDROID__) && !defined(__APPLE__) namespace detail { class EventBaseLocalBase; } template class EventBaseLocal; +#endif class EventBaseObserver { public: @@ -738,12 +740,14 @@ class EventBase : private boost::noncopyable, // allow runOnDestruction() to be called from any threads std::mutex onDestructionCallbacksMutex_; +#if !defined(ANDROID) && !defined(__ANDROID__) && !defined(__APPLE__) // see EventBaseLocal friend class detail::EventBaseLocalBase; template friend class EventBaseLocal; std::mutex localStorageMutex_; std::unordered_map> localStorage_; std::unordered_set localStorageToDtor_; +#endif }; } // folly diff --git a/folly/io/async/EventBaseLocal.cpp b/folly/io/async/EventBaseLocal.cpp index 0f08b639..c8533e6d 100644 --- a/folly/io/async/EventBaseLocal.cpp +++ b/folly/io/async/EventBaseLocal.cpp @@ -14,6 +14,8 @@ * limitations under the License. */ +#if !defined(ANDROID) && !defined(__ANDROID__) && !defined(__APPLE__) + #include #include #include @@ -96,3 +98,5 @@ void EventBaseLocalBase::setVoidUnlocked( std::atomic EventBaseLocalBase::keyCounter_{0}; }} + +#endif // !__ANDROID__ && !ANDROID && !__APPLE__ diff --git a/folly/io/async/EventBaseLocal.h b/folly/io/async/EventBaseLocal.h index 912ba6cf..5681fac6 100644 --- a/folly/io/async/EventBaseLocal.h +++ b/folly/io/async/EventBaseLocal.h @@ -16,6 +16,8 @@ #pragma once +#if !defined(ANDROID) && !defined(__ANDROID__) && !defined(__APPLE__) + #include #include #include @@ -126,3 +128,5 @@ class EventBaseLocal : public detail::EventBaseLocalBase { } + +#endif // !__ANDROID__ && !ANDROID && !__APPLE__ -- 2.34.1