Commit Graph

121 Commits

Author SHA1 Message Date
michael
5c1df42fa4 * Fix bug #32871
git-svn-id: trunk@37962 -
2018-01-13 18:21:44 +00:00
svenbarth
81a0f88d8c + add Delphi compatible TThread.ForceQueue() which enqueues the method also for the main thread (at least if the RTL is in multi threading mode, otherwise it's still executed right away - whether this is Delphi compatible needs to be tested as I only have a 10.1 currently which does not yet support TThread.ForceQueue())
+ added test

git-svn-id: trunk@37359 -
2017-09-29 21:19:45 +00:00
michael
52fe038b53 * use system.HMOdule when available
git-svn-id: trunk@37302 -
2017-09-22 15:29:09 +00:00
pierre
07ba4f8cca Add FSem and FSuspendedExternal private fields for BeOS
git-svn-id: trunk@37260 -
2017-09-20 08:50:08 +00:00
michael
3a046bda5f * Fix bug ID #31647: added new shift state: ssScrollH
git-svn-id: trunk@36768 -
2017-07-23 09:10:11 +00:00
michael
ab0c29e54f * Rename RawByteString version of TstringStream constructor, compiler cannot decide for empty string
git-svn-id: trunk@36759 -
2017-07-21 18:02:26 +00:00
michael
2b1bb6a5f5 * TStringStream now observes encoding, bug ID #30508
git-svn-id: trunk@36758 -
2017-07-21 17:02:37 +00:00
michael
e11821f558 * Patch from Ondrej Pokorny to make Datamodule DPI aware (bug ID 31813)
git-svn-id: trunk@36212 -
2017-05-15 07:13:37 +00:00
pierre
78343902bf Allow objpas classes and sysutils units to compile with threading support disabled
git-svn-id: trunk@36107 -
2017-05-04 22:13:11 +00:00
marco
6166215174 * make istream signedness equal to MSDN and modern delphi. Denis Kozlov,
mantis #31473

git-svn-id: trunk@35542 -
2017-03-08 15:05:11 +00:00
michael
f0a8355b84 * AlwaysQuote added (bug ID 31126)
git-svn-id: trunk@35333 -
2017-01-25 22:37:33 +00:00
michael
2e3ab0d37e * Introduce TFPList.CheckIndex (bug ID 30887)
git-svn-id: trunk@34873 -
2016-11-11 10:26:05 +00:00
michael
9926d37dda * Fix bug #30869, introduce CheckIndex in TStringList
git-svn-id: trunk@34817 -
2016-11-06 17:04:37 +00:00
michael
8318ba30d4 * Patch from Ondrej Pokorny to implement specifying encoding when saving/loading from stream
git-svn-id: trunk@34475 -
2016-09-10 10:59:48 +00:00
svenbarth
d5cc59c22e Avoid the creation of a TExternalThread instance for Synchronize() and Queue() (Delphi does the same).
Note: the Sender parameter of WakeMainThread will be Nil for such threads. This is Delphi compatible.

rtl/objpas/classes/classesh.inc, TThread:
  + TThreadQueueEntry: new field ThreadID so that entries with Thread = Nil can be removed
rtl/objpas/classes/classes.inc, TThread:
  * InitSynchronizeEvent: setup ThreadID field
  * Synchronize: use a local TThreadQueueEntry if no TThread instance was passed in
  * Queue: setup ThreadID
  * RemoveQueueEvents: also check for ThreadID when trying to find the current thread

git-svn-id: trunk@33863 -
2016-05-31 20:01:52 +00:00
michael
10bbfce412 * Allow Find to work with user-sorted stringlists.
git-svn-id: trunk@33328 -
2016-03-26 09:13:27 +00:00
marco
eb1d895718 * fix reexport of record types in classesh, bug #29776 patch by Ondrej.
git-svn-id: trunk@33144 -
2016-03-04 10:42:40 +00:00
michael
789b80f702 * ExecuteInThread added
git-svn-id: trunk@33100 -
2016-02-16 18:59:35 +00:00
michael
db19d73ec0 * Add ClearFirst parameter to AddStrings (bug ID 29630)
git-svn-id: trunk@33092 -
2016-02-13 11:03:51 +00:00
michael
9157a11b7e * Applied partial patch from barlone to change var->out for IdentToInt
git-svn-id: trunk@32825 -
2016-01-01 17:37:46 +00:00
michael
6b3b3d5c0c * Fix bug ID #29155, wrong declaration of ISTream.
git-svn-id: trunk@32820 -
2016-01-01 16:35:38 +00:00
michael
4f82d103af * Added SkipLastLineBreak to TStrings (bug ID 28213)
git-svn-id: trunk@32792 -
2015-12-29 18:48:58 +00:00
michael
e6b86d9b5b * Made string in stringstream constructor optional
git-svn-id: trunk@32326 -
2015-11-15 11:05:19 +00:00
Károly Balogh
1a53f6a799 AROS: in agreement with Marcus Sackrow, AThreads is now enabled for AROS, and the old AROS-specific threading implementation is zapped
git-svn-id: trunk@31008 -
2015-06-07 18:35:50 +00:00
Károly Balogh
632c46bcb6 amicommon: have a generic tthread.inc which even works, given there is a reasonably advanced ThreadManager
git-svn-id: trunk@30914 -
2015-05-25 21:06:53 +00:00
michael
27ff4c95e4 * Made CheckBitIndex protected
git-svn-id: trunk@30622 -
2015-04-17 16:53:23 +00:00
michael
910a88122f * Implemented TWriter.WriteSignature/TReader.ReadSignature (bug ID 27519)
git-svn-id: trunk@30367 -
2015-03-29 13:25:12 +00:00
michael
063d7f1ce2 * Overloaded version of TStrings.Add that accepts Fmt,Args
git-svn-id: trunk@30301 -
2015-03-24 08:47:14 +00:00
michael
e3111faa2e * Implemented LineBreak property for TStrings
git-svn-id: trunk@30300 -
2015-03-24 08:38:52 +00:00
Tomas Hajny
590e2f7977 * fix for bug #16884 for OS/2
git-svn-id: trunk@29712 -
2015-02-15 19:39:53 +00:00
Jonas Maebe
77c1364713 * replaced use of semaphores in Unix version of TThread for suspend/resume
functionality with RTLEvent:
   o the thread manager semaphore functionality isn't used for anything else,
     and the main difference between mutex/condvar and semaphores is that the
     latter can be used for IPC (while the thread manager is always used
     within a single process) and that they are counting (but since a thread
     can only suspend itself nowadays, it cannot be suspended recursively)
   o OS X sandboxing does not support the use of semaphores (or rather: Apple
     does not allow sandboxing rules that enable the use of IPC semaphores in
     the appstore)

git-svn-id: trunk@28965 -
2014-11-02 15:00:24 +00:00
Jonas Maebe
79a40547ca - removed no longer used tthread.FSuspendedExternal
git-svn-id: trunk@28963 -
2014-11-02 15:00:14 +00:00
marcus
980abaa9ba AROS: introduced threading without additional library
git-svn-id: trunk@28682 -
2014-09-16 19:32:56 +00:00
michael
beafc9fe8c * Fix bug #26717
git-svn-id: trunk@28659 -
2014-09-14 15:06:34 +00:00
nickysn
9418fa9b8b * fixed compilation of unit classes with integer=smallint
git-svn-id: trunk@27045 -
2014-03-09 14:21:32 +00:00
nickysn
fec4c6a6e2 * various rtl fixes that allow objpas.integer to be 16-bit on 16-bit targets
(still not sure if it's a good idea, but trying, at least, is harmless - we
  can always rollback to integer being equal to longint)

git-svn-id: trunk@26966 -
2014-03-06 01:10:18 +00:00
michael
b5a2b3860b * Added AddEmptyStrings to ExtractStrings (bug 25633)
git-svn-id: trunk@26600 -
2014-01-28 08:38:29 +00:00
marco
67e64e8be3 * killed a ver2_4 exception
git-svn-id: trunk@26410 -
2014-01-08 14:12:27 +00:00
michael
098769d1b3 * Added TStringList.CompareStrings (Delphi compatibility), patch by Stephano, bug ID #24981
git-svn-id: trunk@25582 -
2013-09-26 18:09:12 +00:00
nickysn
fccbbd92b2 * Classes unit functions related to exceptions and stacktraces updated to use CodePointer
git-svn-id: trunk@25516 -
2013-09-17 22:13:31 +00:00
svenbarth
08543ddeba Fix for Mantis #23899 . Allow to overwrite TStringList.ExchangeItems if necessary.
rtl/objpas/classes/classesh.inc, TStringList:
  * rename the private ExchangeItems to ExchangeItemsInt and allow inlining
  + add a protected virtual ExchangeItems
rtl/objpas/classes/stringl.inc, TStringList:
  * Exchange: call ExchangeItemsInt
  + let default implementation of ExchangeItems simply call ExchangeItemsInt
  * QuickSort: call ExchangeItemsInt directly if there is no override otherwise call ExchangeItems

+ added test

git-svn-id: trunk@25480 -
2013-09-13 14:17:01 +00:00
michael
bda396906d * Forgot to commit
git-svn-id: trunk@25404 -
2013-09-03 12:51:39 +00:00
nickysn
4953fd0bb0 * use CodePointer in Classes.TReader.FindMethod() and TFindMethodEvent for i8086 medium memory model compatibility
git-svn-id: trunk@25153 -
2013-07-20 22:10:22 +00:00
michael
4afefd6cbe * Added AddText as suggested in bug ID #24764
git-svn-id: trunk@25129 -
2013-07-19 07:16:06 +00:00
marco
eebfeca41d * removed all ver2_* defines older than 2_4. 2_4 can probably also get removed from trunk, but better in a separate commit.
git-svn-id: trunk@24971 -
2013-06-25 12:46:30 +00:00
nickysn
730f7c82b7 * some fixes, intended to get units fgl and classes to compile on 16-bit cpus
git-svn-id: trunk@24649 -
2013-05-30 18:58:25 +00:00
svenbarth
930b76e8fb Fix compilation of WinCE. Change the fixed UNICODE define of WinCE to FPC_OS_UNICODE, so that it won't be undefined when changing the mode/string type and that the usage of a UNICODE API is independant of the mode.
Also adjusted all Windows (Win32/64/CE) units to define a "UNICODE" if "FPC_OS_UNICODE" is defined (except the Jedi units).
Also the common RTL units that checked for UNICODE now check for FPC_OS_UNICODE.

git-svn-id: trunk@24420 -
2013-05-04 11:06:32 +00:00
marco
4d9f1629d9 * removed a workaround for pre 2.6.0 fpdocs
git-svn-id: trunk@24294 -
2013-04-21 21:33:10 +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
michael
11a531ab62 * Fixed bug #23477
git-svn-id: trunk@23135 -
2012-12-12 15:21:28 +00:00