Hello,
I've had a look into the ThreadManager mechanism because I thought about implementing thread naming as
TThread.NameThreadForDebugging doesn't do anything yet.
However, I have some questions now:
1. The WinThreadManager is initialized through the TLS callback (regarding comments in system.pp) or directly in system.pp by following statement
if not Assigned(CurrentTM.BeginThread) then
while the default used startup TThreadManager is in inc/thread.inc (as far as I've understood) and always sets
BeginThread : @NoBeginThread;
so how can it be nil?
2. Why is
ThreadSetPriority :=@SysThreadSetPriority;
defined and then not used in win/tthread.inc. It uses the WinAPI function name
procedure TThread.SetPriority(Value: TThreadPriority);
begin
SetThreadPriority(FHandle, Priorities[Value]);
end;
directly instead of the function assigned to the WinThreadManager (ThreadSetPriority) which points to SysThreadSetPriority. This is an inconsistency compared to the other platforms (SetPriority is just one example I've picked).
Is there any special reason for this inconsistency?