From: Misha Shneerson Date: Fri, 7 Nov 2014 20:33:14 +0000 (-0800) Subject: isDetachable for HHWheelTimer X-Git-Tag: v0.22.0~187 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=a082ba9871b5167f62020254bbbc002cdfdbd463;p=folly.git 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 --- 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;