fpc/rtl/unix
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
..
scripts
aliasctp.inc
aliasptp.inc
baseunix.pp
bunxh.inc * move fpgetenv(pchar) to unit system for syscall based *nix rtls. 2012-09-10 09:21:56 +00:00
bunxovl.inc
bunxovlh.inc
classes.pp
clocale.pp
convert.inc
crt.pp
cthreads.pp * terminate with an error when initializing a critical section and recursive 2012-11-18 10:23:44 +00:00
ctypes.inc
cwstraix.inc
cwstring.pp * fixed compatilation on Haiku Alpha4 (patch by Olivier Coursière, 2012-11-10 20:26:46 +00:00
dl.pp
dos.pp
dynlibs.inc
errors.pp
fpmake.inc
genfdset.inc
genfunch.inc
genfuncs.inc * move fpgetenv(pchar) to unit system for syscall based *nix rtls. 2012-09-10 09:21:56 +00:00
gensigset.inc
initc.pp
ipc.pp
ipccdecl.inc
keyboard.pp
lnfogdb.pp
mouse.pp
oscdecl.inc
oscdeclh.inc
ports.pp
printer.pp
serial.pp
settimeo.inc
sockets.pp
syscall.pp
syscgen.inc * move fpgetenv(pchar) to unit system for syscall based *nix rtls. 2012-09-10 09:21:56 +00:00
sysdir.inc
sysfile.inc
sysheap.inc
sysunix.inc rtl: pass exact size to delete instead of full string length 2012-09-18 00:31:21 +00:00
sysunixh.inc
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
terminfo.pp
termiosh.inc
timezone.inc
tthread.inc Extend TThread with (class) methods and (class) properties from Delphi 2007 and newer. 2012-12-27 16:16:17 +00:00
ttyname.inc
unix.pp
unixsockets.pas
unixtype.pp
unixutil.pp
unxdeclh.inc
unxovl.inc
unxovlh.inc
varutils.pp
video.pp
winiconv.inc
x86.pp