io/async/EventBaseLocal.cpp \
io/async/EventBaseManager.cpp \
io/async/EventHandler.cpp \
+ io/async/Request.cpp \
io/async/SSLContext.cpp \
io/async/ScopedEventBaseThread.cpp \
io/async/HHWheelTimer.cpp \
--- /dev/null
+/*
+ * Copyright 2016 Facebook, Inc.
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#include <folly/io/async/Request.h>
+
+namespace folly {
+
+namespace {
+
+using SingletonT = SingletonThreadLocal<std::shared_ptr<RequestContext>>;
+SingletonT singleton;
+}
+
+std::shared_ptr<RequestContext>& RequestContext::getStaticContext() {
+ return singleton.get();
+}
+}
#include <map>
#include <memory>
#include <glog/logging.h>
-#include <folly/ThreadLocal.h>
#include <folly/RWSpinLock.h>
#include <folly/SingletonThreadLocal.h>
}
private:
- static std::shared_ptr<RequestContext>& getStaticContext() {
- using SingletonT = SingletonThreadLocal<std::shared_ptr<RequestContext>>;
- static SingletonT singleton;
- return singleton.get();
- }
+ static std::shared_ptr<RequestContext>& getStaticContext();
folly::RWSpinLock lock;
std::map<std::string, std::unique_ptr<RequestData>> data_;