Bug 5382 – [regression 2.051] DLL multi-threading broken

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-12-28T00:26:00Z
Last change time
2011-02-07T00:33:26Z
Keywords
patch
Assigned to
sean
Creator
r.sagitario

Comments

Comment #0 by r.sagitario — 2010-12-28T00:26:52Z
With the modified circular dependency detection, thread initialization in DLLs no longer works. This happens because the variable _moduleinfo_tlsdtors_i is used to check whether TLS has been initialized, but it is now declared shared. Here's a patch that does no longer rely on this variable: Left file: C:\l\dmd-2.051\src\druntime\src\core\dll_helper.d Right file: C:\l\dmd-2.051\src\druntime\src\core\dll_helper.org 381,383d380 < static bool tlsCtorRun; < static this() { tlsCtorRun = true; } < 389c386 < if( initTls && !tlsCtorRun ) // avoid duplicate calls --- > if( initTls && !_moduleinfo_tlsdtors_i ) // avoid duplicate calls
Comment #1 by bugzilla — 2011-02-07T00:33:26Z