Skip to content

Commit

Permalink
fix(subscriber): fix self wakes count (#430)
Browse files Browse the repository at this point in the history
Self-wakes were not being detected and displayed in the console. The
`burn` task in the `app` example - which deliberately has many
self-wakes - was not registering any.

It appears that a logic error was present in the self-wake counting in
`console-subscriber` since it was added in #238. When a self wake was
detected, the `wakes` count was incremented a second time (the `wakes`
count is incremented for all wakes before checking for a self wake),
instead of increamenting the `self_wakes` count.

This PR fixes the logic so that when a self wake is detected, the
`self_wakes` count is incremented.
  • Loading branch information
hds authored and hawkw committed Sep 29, 2023
1 parent b209dd6 commit d308935
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion console-subscriber/src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ impl TaskStats {

self.wakes.fetch_add(1, Release);
if self_wake {
self.wakes.fetch_add(1, Release);
self.self_wakes.fetch_add(1, Release);
}

self.make_dirty();
Expand Down

0 comments on commit d308935

Please sign in to comment.