Commit 98d3bec7 authored by Jason Rahman's avatar Jason Rahman Committed by Facebook Github Bot

Rename HHWheelTimer::Callback::context_ -> requestContext_

Summary: HHWheelTimer::Callback is frequently used as a base class for callback objects, while context_ is a commonly desired member name in other classes that also serve as base classes for HHWheelTimer::Callback derived classes. Renaming in HHWheelTimer::Callback to free up availability of context_.

Reviewed By: yfeldblum

Differential Revision: D8937020

fbshipit-source-id: 8a4612bc57f28673762604cc118a91a347e5972d
parent 20eea8f0
...@@ -147,7 +147,7 @@ void HHWheelTimer::scheduleTimeout( ...@@ -147,7 +147,7 @@ void HHWheelTimer::scheduleTimeout(
// Cancel the callback if it happens to be scheduled already. // Cancel the callback if it happens to be scheduled already.
callback->cancelTimeout(); callback->cancelTimeout();
callback->context_ = RequestContext::saveContext(); callback->requestContext_ = RequestContext::saveContext();
count_++; count_++;
...@@ -232,7 +232,7 @@ void HHWheelTimer::timeoutExpired() noexcept { ...@@ -232,7 +232,7 @@ void HHWheelTimer::timeoutExpired() noexcept {
count_--; count_--;
cb->wheel_ = nullptr; cb->wheel_ = nullptr;
cb->expiration_ = {}; cb->expiration_ = {};
RequestContextScopeGuard rctx(cb->context_); RequestContextScopeGuard rctx(cb->requestContext_);
cb->timeoutExpired(); cb->timeoutExpired();
if (isDestroyed) { if (isDestroyed) {
// The HHWheelTimer itself has been destroyed. The other callbacks // The HHWheelTimer itself has been destroyed. The other callbacks
......
...@@ -144,7 +144,7 @@ class HHWheelTimer : private folly::AsyncTimeout, ...@@ -144,7 +144,7 @@ class HHWheelTimer : private folly::AsyncTimeout,
list<Callback, boost::intrusive::constant_time_size<false>> list<Callback, boost::intrusive::constant_time_size<false>>
List; List;
std::shared_ptr<RequestContext> context_; std::shared_ptr<RequestContext> requestContext_;
// Give HHWheelTimer direct access to our members so it can take care // Give HHWheelTimer direct access to our members so it can take care
// of scheduling/cancelling. // of scheduling/cancelling.
......
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