Commit 245489e2 authored by Mirek Klimos's avatar Mirek Klimos Committed by Facebook Github Bot

Trying to improve the efficiency of RequestContext callbacks

Summary: Changed RWSpinLock to a SharedMutex in the RequestContext to see if this would lower the overhead of the onSet/onUnset callbacks.

Reviewed By: djwatson

Differential Revision: D3780396

fbshipit-source-id: 3d91f8194357533072fe053d23e0454a36faecff
parent 4b4183ce
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <map> #include <map>
#include <memory> #include <memory>
#include <folly/RWSpinLock.h> #include <folly/SharedMutex.h>
#include <folly/Synchronized.h> #include <folly/Synchronized.h>
namespace folly { namespace folly {
...@@ -99,7 +99,7 @@ class RequestContext { ...@@ -99,7 +99,7 @@ class RequestContext {
static std::shared_ptr<RequestContext>& getStaticContext(); static std::shared_ptr<RequestContext>& getStaticContext();
using Data = std::map<std::string, std::unique_ptr<RequestData>>; using Data = std::map<std::string, std::unique_ptr<RequestData>>;
folly::Synchronized<Data, folly::RWSpinLock> data_; folly::Synchronized<Data, folly::SharedMutex> data_;
}; };
class RequestContextScopeGuard { class RequestContextScopeGuard {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment