Commit ba225d4b authored by Maged Michael's avatar Maged Michael Committed by Facebook Github Bot

RequestContext: Declare gflag, add folly_ prefix to gflag name

Summary:
Declare gflag to enable turning it on and off at run time.
Added folly_ prefix to gflag name to reduce name pollution.

Reviewed By: davidtgoldblatt

Differential Revision: D19144459

fbshipit-source-id: 1e82cb102e47fea856952d1e630c03baf38adf1d
parent 09634ef5
...@@ -23,10 +23,9 @@ ...@@ -23,10 +23,9 @@
#include <folly/MapUtil.h> #include <folly/MapUtil.h>
#include <folly/SingletonThreadLocal.h> #include <folly/SingletonThreadLocal.h>
#include <folly/portability/GFlags.h>
DEFINE_bool( DEFINE_bool(
reqctx_use_hazptr, folly_reqctx_use_hazptr,
false, false,
"RequestContext implementation using hazard pointers"); "RequestContext implementation using hazard pointers");
...@@ -461,7 +460,7 @@ RequestContext::StateHazptr::Combined* RequestContext::StateHazptr::expand( ...@@ -461,7 +460,7 @@ RequestContext::StateHazptr::Combined* RequestContext::StateHazptr::expand(
} }
RequestContext::RequestContext() RequestContext::RequestContext()
: useHazptr_(FLAGS_reqctx_use_hazptr), : useHazptr_(FLAGS_folly_reqctx_use_hazptr),
rootId_(reinterpret_cast<intptr_t>(this)) {} rootId_(reinterpret_cast<intptr_t>(this)) {}
RequestContext::RequestContext(const RequestContext& ctx, RootTag) RequestContext::RequestContext(const RequestContext& ctx, RootTag)
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <folly/Synchronized.h> #include <folly/Synchronized.h>
#include <folly/container/F14Map.h> #include <folly/container/F14Map.h>
#include <folly/portability/GFlags.h>
#include <folly/sorted_vector_types.h> #include <folly/sorted_vector_types.h>
#include <folly/synchronization/Hazptr.h> #include <folly/synchronization/Hazptr.h>
...@@ -26,6 +27,8 @@ ...@@ -26,6 +27,8 @@
#include <mutex> #include <mutex>
#include <string> #include <string>
DECLARE_bool(folly_reqctx_use_hazptr);
namespace folly { namespace folly {
/* /*
......
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