projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Faster onDestroy
[folly.git]
/
folly
/
io
/
async
/
DelayedDestructionBase.h
diff --git
a/folly/io/async/DelayedDestructionBase.h
b/folly/io/async/DelayedDestructionBase.h
index bd68c1cb89daaccfd6c164ae76ae94633ff0384c..52505a064c892c69adcc4fb63524f0f73ace560e 100644
(file)
--- a/
folly/io/async/DelayedDestructionBase.h
+++ b/
folly/io/async/DelayedDestructionBase.h
@@
-37,7
+37,7
@@
namespace folly {
*
* Classes needing this functionality should:
* - derive from DelayedDestructionBase directly
*
* Classes needing this functionality should:
* - derive from DelayedDestructionBase directly
- * -
pass a callback to onDestroy_
which'll be called before the object is
+ * -
implement onDelayedDestroy
which'll be called before the object is
* going to be destructed
* - create a DestructorGuard object on the stack in each public method that
* may invoke a callback
* going to be destructed
* - create a DestructorGuard object on the stack in each public method that
* may invoke a callback
@@
-93,7
+93,7
@@
class DelayedDestructionBase : private boost::noncopyable {
assert(dd_->guardCount_ > 0);
--dd_->guardCount_;
if (dd_->guardCount_ == 0) {
assert(dd_->guardCount_ > 0);
--dd_->guardCount_;
if (dd_->guardCount_ == 0) {
- dd_->onDe
stroy_
(true);
+ dd_->onDe
layedDestroy
(true);
}
}
}
}
}
}
@@
-213,14
+213,15
@@
class DelayedDestructionBase : private boost::noncopyable {
}
/**
}
/**
- * Implement onDestroy_ in subclasses.
- * onDestroy_() is invoked when the object is potentially being destroyed.
+ * Implement onDelayedDestroy in subclasses.
+ * onDelayedDestroy() is invoked when the object is potentially being
+ * destroyed.
*
* @param delayed This parameter is true if destruction was delayed because
*
* @param delayed This parameter is true if destruction was delayed because
- * of a DestructorGuard object, or false if onDe
stroy_() is
- * being called directly from the destructor.
+ * of a DestructorGuard object, or false if onDe
layedDestroy()
+ *
is
being called directly from the destructor.
*/
*/
-
std::function<void(bool)> onDestroy_
;
+
virtual void onDelayedDestroy(bool delayed) = 0
;
private:
/**
private:
/**