Bug 2419 – Thread.getThis() broken?

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-10-15T07:13:00Z
Last change time
2015-06-09T01:20:16Z
Assigned to
nobody
Creator
johnch_atms

Comments

Comment #0 by johnch_atms — 2008-10-15T07:13:25Z
Thread.getThis throws an exception and prints "didn't find it" on the command line. It appears that Thread.thread_init isn't getting called as it should during gc_init. Only when I explicitly call Thread.thread_init in my main procedure, does Thread.getThis return a valid object. This sample program should repro the issue: import std.thread; void main() { Thread.getThis(); } (Compiled with -debug -g -O -inline flags.)
Comment #1 by andrej.mitrovich — 2013-01-26T18:36:44Z
Works in 2.061 (changing the import to core.thread first).