From 874e174d38be6520f301453f75e4660dc5b158c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Tue, 24 Oct 2017 09:44:54 +0200 Subject: [PATCH] Add const overload for Task.tid. --- source/vibe/core/task.d | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/vibe/core/task.d b/source/vibe/core/task.d index e146d76..09e63e4 100644 --- a/source/vibe/core/task.d +++ b/source/vibe/core/task.d @@ -77,8 +77,14 @@ struct Task { } package @property ref ThreadInfo tidInfo() @system { return m_fiber ? taskFiber.tidInfo : s_tidInfo; } // FIXME: this is not thread safe! + package @property ref const(ThreadInfo) tidInfo() const @system { return m_fiber ? taskFiber.tidInfo : s_tidInfo; } // FIXME: this is not thread safe! + /** Gets the `Tid` associated with this task for use with + `std.concurrency`. + */ @property Tid tid() @trusted { return tidInfo.ident; } + /// ditto + @property const(Tid) tid() const @trusted { return tidInfo.ident; } } T opCast(T)() const @safe nothrow if (is(T == bool)) { return m_fiber !is null; }