Not to use EventBaseLocal on mobile
authorMichael Lee <mzlee@fb.com>
Fri, 31 Jul 2015 22:51:59 +0000 (15:51 -0700)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Fri, 31 Jul 2015 23:22:17 +0000 (16:22 -0700)
Summary: Temp remove EventBaseLocal on mobile.

Reviewed By: @djwatson

Differential Revision: D2302322

folly/io/async/EventBase.cpp
folly/io/async/EventBase.h
folly/io/async/EventBaseLocal.cpp
folly/io/async/EventBaseLocal.h

index 4fe704a192699d810be7f937b3a86ede8321c7fe..1f23b2b60df72651048332b97dd58bb496bd73e2 100644 (file)
@@ -239,12 +239,14 @@ EventBase::~EventBase() {
     event_base_free(evb_);
   }
 
+#if !defined(ANDROID) && !defined(__ANDROID__) && !defined(__APPLE__)
   {
     std::lock_guard<std::mutex> lock(localStorageMutex_);
     for (auto storage : localStorageToDtor_) {
       storage->onEventBaseDestruction(*this);
     }
   }
+#endif
   VLOG(5) << "EventBase(): Destroyed.";
 }
 
index 41bf0aeaad0d96423c7157f502515c7b3fa344d3..e15465c9e12fb673f686d6d9a12976a401764f9b 100644 (file)
@@ -47,11 +47,13 @@ typedef std::function<void()> Cob;
 template <typename MessageT>
 class NotificationQueue;
 
+#if !defined(ANDROID) && !defined(__ANDROID__) && !defined(__APPLE__)
 namespace detail {
 class EventBaseLocalBase;
 }
 template <typename T>
 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 <typename T> friend class EventBaseLocal;
   std::mutex localStorageMutex_;
   std::unordered_map<uint64_t, std::shared_ptr<void>> localStorage_;
   std::unordered_set<detail::EventBaseLocalBase*> localStorageToDtor_;
+#endif
 };
 
 } // folly
index 0f08b639e39f4a64d8c2d45acadce3d6923045a0..c8533e6d97a60495236a8a855a96ea986253c316 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#if !defined(ANDROID) && !defined(__ANDROID__) && !defined(__APPLE__)
+
 #include <folly/io/async/EventBaseLocal.h>
 #include <atomic>
 #include <thread>
@@ -96,3 +98,5 @@ void EventBaseLocalBase::setVoidUnlocked(
 
 std::atomic<uint64_t> EventBaseLocalBase::keyCounter_{0};
 }}
+
+#endif // !__ANDROID__ && !ANDROID && !__APPLE__
index 912ba6cf4c08d4baa86cafd0cdecbf4061888a57..5681fac67f4aa56c32fb5df4d687408691698651 100644 (file)
@@ -16,6 +16,8 @@
 
 #pragma once
 
+#if !defined(ANDROID) && !defined(__ANDROID__) && !defined(__APPLE__)
+
 #include <boost/noncopyable.hpp>
 #include <folly/Synchronized.h>
 #include <folly/io/async/EventBase.h>
@@ -126,3 +128,5 @@ class EventBaseLocal : public detail::EventBaseLocalBase {
 
 
 }
+
+#endif // !__ANDROID__ && !ANDROID && !__APPLE__