0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd::ios: Add a handler epoch counter.

This commit is contained in:
Jason Volk 2019-07-15 16:02:40 -07:00
parent ebbc5a5be0
commit 2bcfe14822
2 changed files with 8 additions and 2 deletions

View file

@ -148,6 +148,7 @@ struct ircd::ios::descriptor::stats
struct ircd::ios::handler
{
static thread_local handler *current;
static thread_local uint64_t epoch;
static void *allocate(handler *const &, const size_t &);
static void deallocate(handler *const &, void *const &, const size_t &) noexcept;

View file

@ -153,9 +153,14 @@ ircd::ios::descriptor::stats::operator+=(const stats &o)
// handler
//
decltype(ircd::ios::handler::current) thread_local
decltype(ircd::ios::handler::current)
thread_local
ircd::ios::handler::current;
decltype(ircd::ios::handler::epoch)
thread_local
ircd::ios::handler::epoch;
bool
ircd::ios::handler::fault(handler *const &handler)
noexcept
@ -208,7 +213,7 @@ noexcept
assert(descriptor.stats);
auto &stats(*descriptor.stats);
++stats.calls;
++handler::epoch;
assert(!handler::current);
handler::current = handler;
handler->slice_start = cycles();