From 1284858d2c0034c0e38d4eea174657cba5828134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Tue, 22 Jan 2019 18:03:49 +0100 Subject: [PATCH] Avoid TLS overhead for TimerCallbackH and make it fully private. --- source/vibe/core/core.d | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/vibe/core/core.d b/source/vibe/core/core.d index 8ad1cf5..554a6a6 100644 --- a/source/vibe/core/core.d +++ b/source/vibe/core/core.d @@ -1142,9 +1142,10 @@ struct Timer { } } -/// private -struct TimerCallbackHandler(CALLABLE) { - static TimerCallbackHandler instance; +private struct TimerCallbackHandler(CALLABLE) { + static __gshared TimerCallbackHandler ms_instance; + static @property ref TimerCallbackHandler instance() @trusted nothrow { return ms_instance; } + void handle(TimerID timer, bool fired) @safe nothrow { if (fired) {