26.11.2011 21:40, Sven Barth пишет:
On 26.11.2011 19:50, Sergei Gorelkin wrote:
26.11.2011 17:18, Leonardo M. Ramé пишет:


$0040C776 is systhrd.inc line 125 "if TLSKey=$ffffffff then RunError(226)
$0040FB59 is syswin.inc line 356, DLL_THREAD_ATTACH branch of
exec_tls_callback

This is TLS callback feature showing its dark side.

Something specfic to your system is creating a thread in your ppc2.exe,
presumably it happens before ppc2.exe is initialized (if it initializes,
TLSKey will receive value other than -1).


If your assumption should be correct, what can be done against this from FPC 
side?

At this point I have two ideas:
1) Initialize TLSKey in DLL_PROCESS_ATTACH branch of callback
2) Make all this callback stuff optional, because it is actually needed for very few cases. "Optional" means referencing it from a fake function, which users who need the feature should call or reference. Otherwise it is smartlinked away.

Regards,
Sergei
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to