Bug 17234 – access to registered thread names

Status
REOPENED
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2017-02-28T10:52:26Z
Last change time
2024-12-01T16:29:53Z
Assigned to
No Owner
Creator
Oleg B
Moved to GitHub: phobos#10243 →

Comments

Comment #0 by code.viator — 2017-02-28T10:52:26Z
std.concurrency have `register` function for associate tid with some name and tid can be obtained by this name, but no accessors for get all associate names by tid. This information stored in private __gshared variable `namesByTid` and can be provided by function `string[] registredNames(Tid tid)` for example.
Comment #1 by razvan.nitu1305 — 2017-07-14T13:17:48Z
Comment #2 by razvan.nitu1305 — 2017-07-14T13:40:02Z
*** Issue 17231 has been marked as a duplicate of this issue. ***
Comment #3 by b2.temp — 2020-02-20T11:58:30Z
this was added at some point: Tid locate(string name);
Comment #4 by simen.kjaras — 2020-02-20T12:15:48Z
locate goes the opposite way: Given a name, get the tid. What's being requested here is given a tid, get the name(s). Something like this: /** * Gets the names associated with tid. * * Params: * tid = The Tid to locate within the registry. * * Returns: * The associated names or null if tid is not registered. */ string[] locate(Tid tid) { synchronized (registryLock) { if (auto name = tid in namesByTid) return *name; return []; } }
Comment #5 by robert.schadek — 2024-12-01T16:29:53Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10243 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB