Commit 2a4fe7ca authored by Lee Howes's avatar Lee Howes Committed by Facebook GitHub Bot

Rename ForbidTag to TrackTag to be more consistent with its implementation

Summary: Rename ForbidTag to TrackTag as a counter to PermitTag. ForbidTag did not capture the idea that in practice we simply log blocking operations. TrackTag allows for that and opens scope for a more aggressive form of tracking on top.

Reviewed By: andriigrynenko

Differential Revision: D27914911

fbshipit-source-id: d56132b7e389825167503934b7af08f9a3ccf1fe
parent b756d166
......@@ -77,7 +77,7 @@ ExecutorBlockingGuard::ExecutorBlockingGuard(PermitTag) noexcept
}
ExecutorBlockingGuard::ExecutorBlockingGuard(
ForbidTag, StringPiece name) noexcept
TrackTag, StringPiece name) noexcept
: list_{true, executor_blocking_list, {name}} {
if (executor_blocking_list_enabled) {
executor_blocking_list = &list_;
......
......@@ -325,13 +325,13 @@ static_assert(
class ExecutorBlockingGuard {
public:
struct PermitTag {};
struct ForbidTag {};
struct TrackTag {};
~ExecutorBlockingGuard();
ExecutorBlockingGuard() = delete;
explicit ExecutorBlockingGuard(PermitTag) noexcept;
explicit ExecutorBlockingGuard(ForbidTag, StringPiece name) noexcept;
explicit ExecutorBlockingGuard(TrackTag, StringPiece name) noexcept;
ExecutorBlockingGuard(ExecutorBlockingGuard&&) = delete;
ExecutorBlockingGuard(ExecutorBlockingGuard const&) = delete;
......
......@@ -250,7 +250,7 @@ bool CPUThreadPoolExecutor::taskShouldStop(folly::Optional<CPUTask>& task) {
void CPUThreadPoolExecutor::threadRun(ThreadPtr thread) {
this->threadPoolHook_.registerThread();
ExecutorBlockingGuard guard{ExecutorBlockingGuard::ForbidTag{}, executorName};
ExecutorBlockingGuard guard{ExecutorBlockingGuard::TrackTag{}, executorName};
thread->startupBaton.post();
while (true) {
......
......@@ -336,7 +336,7 @@ folly::Executor::KeepAlive<> EDFThreadPoolExecutor::deadlineExecutor(
void EDFThreadPoolExecutor::threadRun(ThreadPtr thread) {
this->threadPoolHook_.registerThread();
ExecutorBlockingGuard guard{ExecutorBlockingGuard::ForbidTag{}, executorName};
ExecutorBlockingGuard guard{ExecutorBlockingGuard::TrackTag{}, executorName};
thread->startupBaton.post();
for (;;) {
......
......@@ -311,7 +311,7 @@ void EventBase::waitUntilRunning() {
// enters the event_base loop -- will only exit when forced to
bool EventBase::loop() {
ExecutorBlockingGuard guard{ExecutorBlockingGuard::ForbidTag{}, executorName};
ExecutorBlockingGuard guard{ExecutorBlockingGuard::TrackTag{}, executorName};
return loopBody();
}
......
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