Add const overload for Task.tid.
This commit is contained in:
parent
db449e3cb3
commit
874e174d38
|
@ -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; }
|
||||
|
|
Loading…
Reference in a new issue