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; }