Bug 20160 – ThreadInfo.cleanup() clears local thread's registered names instead of "this"'s
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2019-08-23T22:11:19Z
Last change time
2019-12-11T23:10:14Z
Keywords
pull
Assigned to
No Owner
Creator
jacob
Comments
Comment #0 by look.at.me.pee.please — 2019-08-23T22:11:19Z
Effectively the issue is cleanup() in ThreadInfo was unregistering names for the local thread being executed, rather than the ThreadInfo that the method was called with.
import std.concurrency;
void main() {
register("main_thread", thisTid());
ThreadInfo t;
t.cleanup(); // unregisters ThreadInfo.thisInfo Tid instead of "t"'s
assert(locate("main_thread") == thisTid()); // fails
}
Comment #1 by dlang-bot — 2019-08-23T22:13:08Z
@look-at-me updated dlang/phobos pull request #7152 "Update ThreadInfo.cleanup() to unregister itself instead of the local thread's" fixing this issue:
- Fix issue 20160: Update ThreadInfo.cleanup() to unregister itself instead of the local thread's
https://github.com/dlang/phobos/pull/7152
Comment #2 by dlang-bot — 2019-12-11T13:37:21Z
@berni44 created dlang/phobos pull request #7314 "Fix Issue 20160 - ThreadInfo.cleanup() clears local thread's..." fixing this issue:
- Fix Issue 20160 - ThreadInfo.cleanup() clears local thread's
registered names instead of "this"'s
https://github.com/dlang/phobos/pull/7314
Comment #3 by dlang-bot — 2019-12-11T23:10:14Z
dlang/phobos pull request #7314 "Fix Issue 20160 - ThreadInfo.cleanup() clears local thread's..." was merged into master:
- c8331f13a0cdbbbec9540875e6af1514f09de917 by Bernhard Seckinger:
Fix Issue 20160 - ThreadInfo.cleanup() clears local thread's
registered names instead of "this"'s
https://github.com/dlang/phobos/pull/7314