[fpc-pascal] Re: Disk Full

Bernd Kreuss prof7bit at googlemail.com
Mon Oct 11 00:16:30 CEST 2010


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?



More information about the fpc-pascal mailing list