From a082ba9871b5167f62020254bbbc002cdfdbd463 Mon Sep 17 00:00:00 2001 From: Misha Shneerson Date: Fri, 7 Nov 2014 12:33:14 -0800 Subject: [PATCH] isDetachable for HHWheelTimer Summary: title Test Plan: unit tests Reviewed By: andrei.bajenov@fb.com Subscribers: trunkagent, mcduff, hitesh, alandau, bmatheny, njormrod, mshneer, folly-diffs@, andreib, davejwatson FB internal diff: D1666499 Tasks: 5563183 Signature: t1:1666499:1415347256:d58c8bbe952385c1c96f7f8cc6ae7f02216c56bb --- folly/io/async/HHWheelTimer.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/folly/io/async/HHWheelTimer.h b/folly/io/async/HHWheelTimer.h index 66ad4232..b1f160c5 100644 --- a/folly/io/async/HHWheelTimer.h +++ b/folly/io/async/HHWheelTimer.h @@ -187,6 +187,10 @@ class HHWheelTimer : private folly::AsyncTimeout, catchupEveryN_ = everyN; } + bool isDetachable() const { + return !folly::AsyncTimeout::isScheduled(); + } + using folly::AsyncTimeout::attachEventBase; using folly::AsyncTimeout::detachEventBase; using folly::AsyncTimeout::getTimeoutManager; -- 2.34.1