#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_;