from rtl/win/syswin.inc:

>        DLL_THREAD_ATTACH :
>          begin
>            inclocked(Thread_count);
> 
>            WinEnterCriticalSection(AttachingThread);
>            if Win32GetCurrentThreadId <> MainThreadIdWin32 then
>            begin
>              { Allocate Threadvars  }
>              SysAllocateThreadVars;
> 
>              { NS : no idea what is correct to pass here - pass dummy value 
> for now }
>              { passing a dummy is ok, the correct value is read from the coff 
> header of SysInstance (FK) }
>              InitThread($1000000); { Assume everything is idempotent there, 
> as the thread could have been created with BeginThread... }
>            end;
> 
>            if assigned(Dll_Thread_Attach_Hook) then
>              Dll_Thread_Attach_Hook(DllParam);
>            Dll_entry:=true; { return value is ignored }
>            WinLeaveCriticalSection(AttachingThread);
>         end;

will this also work when some object in my own dll is starting a thread
with TThread that is already properly initialized or will it then try to
initialize it twice?
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to