fpc/rtl/win
svenbarth 764f36a179 Extend TThread with (class) methods and (class) properties from Delphi 2007 and newer.
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 -
2012-12-27 16:16:17 +00:00
..
wininc * Fixed HKEY_xxx defines for win64. For example HKEY_CLASSES_ROOT should be $FFFFFFFF80000000 on win64 instead of $80000000. Most registry API functions accept invalid HKEY_xxx values. But some registry functions like RegOverridePredefKey() require proper values. I had spent several hours fighting with RegOverridePredefKey() on win64 until I have found what had been wrong. 2012-12-22 16:15:32 +00:00
crt.pp * crtwrite didn't handle buffer writes > 255 chars properly, and the textrec buffer is 256 currently (and has been since svn history start). Mantis #22334 2012-06-30 13:23:26 +00:00
dos.pp * Explicitly disable checkpointer for functions using GetEnvironmentStrings 2012-01-26 13:50:36 +00:00
dynlibs.inc * Fixed compilation (mantis #22413) 2012-07-12 08:37:40 +00:00
fpcmemdll.pp
fpwinsockh.inc
keyboard.pp
messages.pp
mouse.pp
printer.pp
sharemem.pp
sockets.pp * add comment to size_t definition. Documents issue #22834 a bit. 2012-10-12 08:07:17 +00:00
sysdir.inc + FileNameCasePreserving added - see #18066 in Mantis 2012-04-15 21:21:53 +00:00
sysfile.inc * patch by Ludo Brands to fix #20481: GetFileType cannot be used on windows to determine if a handle is a console handle because the function does not distinguish between consoles and printers, resolves #20481 2011-10-23 14:20:00 +00:00
sysheap.inc
sysos.inc * Moved DLL_xxx declarations to sysos.inc, so they can be reused by wince. 2012-02-16 17:13:32 +00:00
sysosh.inc
systhrd.inc + Add _FPC_TlsSize public symbol for use by heaptrc unit 2012-01-26 13:51:34 +00:00
systlsdir.inc * Moved DLL_xxx declarations to sysos.inc, so they can be reused by wince. 2012-02-16 17:13:32 +00:00
sysutils.pp Add platform independant support for "GetTickCount" and "GetTickCount64" to unit "SysUtils". "GetTickCount" is declared as deprecated from the beginning and thus "GetTickCount64" should be used instead. 2012-12-23 16:12:57 +00:00
syswin.inc Win32 and Win64, fixed DLL exit sequence, resolves #14603: 2012-02-16 23:39:03 +00:00
tthread.inc Extend TThread with (class) methods and (class) properties from Delphi 2007 and newer. 2012-12-27 16:16:17 +00:00
varutils.pp
video.pp * fix memory leak of video unit as proposed by Michael Karst, resolves #22876 2012-11-04 18:42:47 +00:00
windirs.pp
winevent.pp
winres.inc
winsock2.pp * fix some of the overloads for -A and -W routines. 2012-09-20 16:56:28 +00:00
winsock.pp * correct INVALID_SOCKET to NOT 0, mantis #20946 2011-12-22 12:20:00 +00:00