Skip to main content

Module census

Module census 

Source
Expand description

Opt-in poll census for tests that guard the single-thread assumption (PR #247 review).

While armed, every poll/check on any thread is counted as either scoped (its thread had a scope installed) or unscoped. A test arms it, runs an ordering inside a scope, and asserts unscoped == 0 and scoped > 0. A non-zero unscoped means some poll ran on a thread the interrupt never reached. Disarmed (always, outside such tests), the cost is one relaxed atomic load per poll. Run each census test in its own test binary, so that no unrelated thread polls while it is armed.

Structs§

Counts
Poll counts gathered by take.

Functions§

arm
Zero the counters and start counting.
take
Stop counting and return what was counted since arm.