Commit Graph

10 Commits

Author SHA1 Message Date
michael
a14117e0bb * Merging revisions r45805 from trunk:
------------------------------------------------------------------------
    r45805 | michael | 2020-07-19 00:35:36 +0200 (Sun, 19 Jul 2020) | 1 line
    
    * Add TerminatedSet (delphi compatibility, bug ID #37388)
    ------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@46598 -
2020-08-23 09:24:13 +00:00
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
tom_at_work
367df58016 * stack related things (sizes, calculations, etc.) are now 64 bit on 64 bit platforms
* default stack size is now also 32k for Windows (allows the use of stack checking when using threads)

git-svn-id: trunk@1718 -
2005-11-10 17:06:25 +00:00
tom_at_work
324dd47e7e * added stacksize parameter for TThread.Create for some platforms left out in commit 1621
git-svn-id: trunk@1637 -
2005-11-03 15:44:22 +00:00
peter
4ace790492 * remove $Log
git-svn-id: trunk@231 -
2005-06-07 09:47:55 +00:00
fpc
790a4fe2d3 * log and id tags removed
git-svn-id: trunk@42 -
2005-05-21 09:42:41 +00:00
fpc
50778076c3 initial import
git-svn-id: trunk@1 -
2005-05-16 18:37:41 +00:00
florian
44b332f82a * generic tthread.synchronize
* delphi compatible wakemainthread
2005-02-25 21:41:09 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
peter
3d27318cb2 * moved classes unit to rtl 2003-10-06 21:01:06 +00:00