Parcourir la source

* Reverted r19693, calling SysInitMultithreading from PROCESS_ATTACH is plain wrong because it depends on initialized thread manager. Calling InitSystemThreads is more correct, but in case of Win32 it further depends on EnrtyInformation, which is not available at this point. Properly solving the issue requires moving the entire TLS stuff into sysinit units or something like that.

git-svn-id: trunk@19715 -
sergei il y a 13 ans
Parent
commit
37abdd52df
1 fichiers modifiés avec 7 ajouts et 4 suppressions
  1. 7 4
      rtl/win/syswin.inc

+ 7 - 4
rtl/win/syswin.inc

@@ -341,11 +341,14 @@ procedure Exec_Tls_callback(Handle : pointer; reason : Dword; Reserved : pointer
        { For executables, DLL_PROCESS_ATTACH is called *before* the entry point,
          and DLL_PROCESS_DETACH is called *after* RTL shuts down and calls ExitProcess.
          It isn't a good idea to handle resources of the main thread at these points.
-         SysInitMultithreading is necessary however, because if some statically loaded
+         InitSystemThreads is necessary however, because if some statically loaded
          DLL creates a thread, it will invoke DLL_THREAD_ATTACH before anything else is
-         initialized. }
-       DLL_PROCESS_ATTACH:
-         SysInitMultithreading;
+         initialized.
+         TODO: The problem is that InitSystemThreads depends (in case of Win32) on EntryInformation
+         which is not available at this point. Solving it properly needs to move this routine
+         to sysinit unit or something like that. }
+//       DLL_PROCESS_ATTACH:
+//         InitSystemThreads;
 
        DLL_THREAD_ATTACH :
          begin