Avoid TLS overhead for TimerCallbackH and make it fully private.

This commit is contained in:
Sönke Ludwig 2019-01-22 18:03:49 +01:00
parent b5ccb784a1
commit 1284858d2c

View file

@ -1142,9 +1142,10 @@ struct Timer {
} }
} }
/// private private struct TimerCallbackHandler(CALLABLE) {
struct TimerCallbackHandler(CALLABLE) { static __gshared TimerCallbackHandler ms_instance;
static TimerCallbackHandler instance; static @property ref TimerCallbackHandler instance() @trusted nothrow { return ms_instance; }
void handle(TimerID timer, bool fired) void handle(TimerID timer, bool fired)
@safe nothrow { @safe nothrow {
if (fired) { if (fired) {