Especially for the introduction of the Queue method the internal Synchronize handling was modified. Instead of handling only one event there is now a queue of events which is walked completely when CheckSynchronize is called. Each entry in the queue can carry a PRTLEvent which will be signaled when the contained method has been executed and thus Synchronize methods can still be blocking.
Exceptions inside the queued methods are either handed back to the calling method for Synchronize events or raised directly (after leaving the queue in a valid state) to the caller of CheckSynchronize.
The way platform specific adjustments can be made to TThread was changed. Instead of implementing the Constructor and Destructor directly one now implements the methods SysCreate and SysDestroy which are called from the Constructor and Destructor respectively. All RTLs were adjusted for this and should be controlled by the platform maintainers for correct compilation (Unix works).
The new method NameThreadForDebugging has two overloaded variants: one with the thread name as AnsiString and one with the thread name as UnicodeString.
By default the AnsiString variant calls the UnicodeString variant and the latter needs to be implemented. This can be changed by defining THREADNAME_IS_ANSISTRING for a platform. Then the UnicodeString variant calls the AnsiString one and the AnsiString one needs to be implemented.
Also added was a global property CPUCount for the System unit. This property returns the number of virtual cores of the system.
New methods and functions that should be implemented per platform are:
System.GetCPUCount (default returns 1)
Classes.TThread.GetSystemTimes (default zeros the struct)
Classes.TThread.NameThreadForDebugging (default does nothing)
More detailed information about the added methods will be available in the feature announcement mail.
git-svn-id: trunk@23227 -
The default implementation of "GetTickCount" just uses the lower 32-Bit from the result of "GetTickCount64".
The default implementation of "GetTickCount64" is based upon "Now" for systems that support a floating point unit (and thus "Now").
Other systems can define a "SysTimerTick" function which is used instead if "HAS_SYSTIMERTICK" is defined.
The Windows implementation of "GetTickCount" uses Windows' "GetTickCount" function.
The implemenation of "GetTickCount64" checks whether the system is a Windows Vista or newer and then uses Windows' "GetTickCount64" function. Otherwise Windows' "GetTickCount" is used also.
The Unix implementation of "GetTickCount" is the default one.
The "GetTickCount64" implementation uses "fpgettimeofday".
git-svn-id: trunk@23215 -
and gave it the correct type (TRelocateThreadVarHandler)
* changed parameter type of InitThread also to TRelocateThreadVarHandler
git-svn-id: trunk@23130 -
before it because the value is too small, regardless of what the format
pattern sepcifies (patch by Bart Broersma, mantis #13076)
git-svn-id: trunk@23095 -
mutexes are not available, since one of the expected properties of
(Delphi/Windows-compatible) critical sections is that they ar
re-entrant (mantis #23334)
git-svn-id: trunk@23011 -
All systems i know of define ntohl and htonl to use unsigned 32bit
types. To keep backward compatibility for now I've added overloaded
versions so the impact on existing code is a small as possible. But I've
marked the signed versions as deprecated.
The code will now also use SwapEndian which is available as optimized
versions on some platforms.
git-svn-id: trunk@22994 -
correctly calculate and pass on the addresses for the parameters and the environment; this way parameters can now be used, but reading environment variables still does not seem to work...
Note: the other assembler files (especially cprt0.as) were not adjusted and might not work at all
git-svn-id: trunk@22936 -
if an address is passed the compiler cannot know a good
value for the frame so it passed nil and no stack trace is printed, resolves#12528
git-svn-id: trunk@22932 -
completely disable the "fast loop" code for Coldfire instead of "hackfixing" it; with this StdIO starts to work (though one byte is missing at the end...)
git-svn-id: trunk@22883 -