Skip to content

Commit

Permalink
Add 'runnable' callback to ExecutionObserver
Browse files Browse the repository at this point in the history
Summary: Add a callback when a fiber becomes runnable

Test Plan: unit tests

Reviewed By: @andriigrynenko

Differential Revision: D2081306
  • Loading branch information
Brian Watling authored and Pavlo Kushnir committed May 28, 2015
1 parent a36acdf commit 979b40c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mcrouter/CyclesObserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ namespace facebook { namespace memcache { namespace mcrouter {

class CyclesObserver : public folly::fibers::ExecutionObserver {
public:
void starting() noexcept override {
void starting(uintptr_t id) noexcept override {
if (!cycles::start()) {
// Should never happen
DCHECK(false) << "There is already one cycles interval "
"active in this thread";
}
}
void stopped() noexcept override {
void runnable(uintptr_t id) noexcept override {}
void stopped(uintptr_t id) noexcept override {
cycles::finish();
}
};
Expand Down

0 comments on commit 979b40c

Please sign in to comment.