isDetachable for HHWheelTimer
authorMisha Shneerson <mshneer@fb.com>
Fri, 7 Nov 2014 20:33:14 +0000 (12:33 -0800)
committerPavlo Kushnir <pavlo@fb.com>
Sat, 8 Nov 2014 02:42:29 +0000 (18:42 -0800)
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

index 66ad4232afce192dd880252f5fe4aecaff22abaa..b1f160c570cf6c2eacdec3d0bc79b9310157257b 100644 (file)
@@ -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;