Add const overload for Task.tid.

This commit is contained in:
Sönke Ludwig 2017-10-24 09:44:54 +02:00
parent db449e3cb3
commit 874e174d38

View file

@ -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 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; } @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; } T opCast(T)() const @safe nothrow if (is(T == bool)) { return m_fiber !is null; }