Commit Graph

63 Commits

Author SHA1 Message Date
pierre
4a9c8e330b + Move EXEC_callback into separate file win/systlsdir.inc
* In win32/sysinitXX units, rename EntryInforation
    to SysInitEntryInformation.
    include new win/systlsdir.inc file from
    win/syswin.inc for win64 target
    and from win32/sysinit.inc for win32 target.
    Set fields of both SysInitEntryInformation and EntryInformation
    by converting them into typed constants.

git-svn-id: trunk@19779 -
2011-12-08 16:11:07 +00:00
florian
f14e0a25c6 * reduce code size of dummy threading routines
* threading manager of the embedded target uses only one dummy routine to reduce code size

git-svn-id: trunk@19169 -
2011-09-21 21:00:15 +00:00
sergei
24c3a43b35 * Call SysFlushStdio from FlushThread, instead of duplicating its functionality.
* Don't call FlushThread from EndThread, since r17798 it is called from DoneThread.

git-svn-id: trunk@18018 -
2011-07-25 06:03:40 +00:00
Jonas Maebe
d85ccd7418 * fixed compilation on targets where tthreadid is not an integer type after
r17992

git-svn-id: trunk@17993 -
2011-07-16 12:03:35 +00:00
sergei
5c3aca5148 * thread.inc, DoneThread: allow CurrentTM.ReleaseThreadVars to be unassigned and reset ThreadID (in preparation to support Windows native threadvars)
* win/systhrd.inc: added error checking in several places. Fail with code 226 if resources cannot be allocated, as Delphi does.
* win/syswin.inc, Dll_entry: Don't call DoneThread in PROCESS_DETACH callback, it is redundant because the main thread is finalized by FPC_DO_EXIT. SysReleaseThreadVars is still necessary. Also removed redundant assignments to return value.

git-svn-id: trunk@17992 -
2011-07-15 23:57:23 +00:00
pierre
2d5ca71a06 + New procedure SysFlushStdIO (code taken from InternalExit).
* InternalExit: now calls new procedure SysFlushStdIO
 * DoneThread: Also calls SysFlushStdIO to avoid loosing output
 if standard files are redirected.

git-svn-id: trunk@17798 -
2011-06-22 16:16:27 +00:00
marco
8cce3d3f91 * closethread thread manager field/function. Mantis 13160
git-svn-id: trunk@15072 -
2010-03-26 23:31:52 +00:00
marco
c477df5046 * TCriticalSection.Tryenter support (Mantis 15928) + short test/demo
tested on FreeBSD (general Unix) and Windows. Note that Haiku seems 
    to have a native threadmgr rather than the Unix one. Will notify 
    maintainer (Olivier)

git-svn-id: trunk@15026 -
2010-03-21 11:34:05 +00:00
Jonas Maebe
13e8b3f23e * don't give a "NoThreadError" for any default rtl/basicevent* routines,
so the TMultiReadExclusiveWriteSynchronizer routines can be safely
    executed even with the default thread manager -> removed ismultithread
    checks, so that it keeps working even if ismultithread is set to true
    between acquiring and freeing a lock (mantis #15619)

git-svn-id: trunk@14830 -
2010-01-29 21:01:11 +00:00
Jonas Maebe
356845ba1e * set function results for unimplemented generic thread manager routines
(to remove warnings)
  * don't give a thread error for basicevent and threadevent routines if
    isMultiThreaded is false, except for the waiting routines (the new
    TMultiReadExclusiveWriteSynchronizer creates/sets such events in the
    constructor, which caused thread manager errors in case cthreads was
    not used under unix)
  * don't perform any actual locking in TMultiReadExclusiveWriteSynchronizer
    routines if isMultiThreaded is false (in order to avoid the errors
    described above)
  + added generic RTLeventResetEvent stub

git-svn-id: trunk@14592 -
2010-01-10 11:04:05 +00:00
Jonas Maebe
0597c300f4 * applied feature dependencies patch by Sven Barth from mantis #13673 :
o i386/i386.inc used a function (fpc_truely_ansistr_unique) is now
     only included if FPC_HAS_FEATURE_ANSISTRINGS is enabled (all other
     platforms use the Pascal-only implementations)
   o inc/heap.inc relied on threading
   o inc/threads.inc relied on exceptions, consoleio and stackcheck
   o inc/system.inc: just a feature-related "variable not used"-hint

git-svn-id: trunk@13121 -
2009-05-09 20:08:57 +00:00
micha
83b7f81f81 + add no-fpu support to compiler/rtl for powerpc-linux (-Cfnone)
git-svn-id: trunk@10422 -
2008-03-02 12:59:02 +00:00
peter
5acb3649df * revert r9557, the performance impact is to big for an academic corner
case optimziation

git-svn-id: trunk@9603 -
2007-12-31 13:36:16 +00:00
yury
c4e60fd1a5 - Removed systhrd.inc from targets where thread manager is stub by default. Stub is installed in common thread.inc file if DISABLE_NO_THREAD_MANAGER is not defined.
git-svn-id: trunk@9558 -
2007-12-28 15:21:02 +00:00
yury
0dcad4d822 * Implemented late thread manager initialization. Thread manager code is not included to executable if thread stuff are not used. WinCE executable size is reduced by 4KB, Win32 executable size is reduced by 3KB. No testsuite regressions.
git-svn-id: trunk@9557 -
2007-12-28 14:40:28 +00:00
florian
7da7364ee7 * refactored SysResetFPU into SysInitFPU and SysResetFPU
git-svn-id: trunk@8966 -
2007-10-28 12:06:49 +00:00
Jonas Maebe
0d8594a705 * made cwstring thread safe without locks + test (twide4): widestring
manager now has two extra parameterless procedures (ThreadInitProc
    and ThreadFiniProc) which are called whenever a thread begins/ends,
    and cwstring uses these to create separate iconv handles for
    each thread (via threadvars)
  * renamed UCS4 to UCS-4BE/LE, because UCS4 is not recognised by most
    systems
  * clean up all iconv handles on exit, and check whether they are
    valid before doing so

git-svn-id: trunk@7949 -
2007-07-04 18:10:34 +00:00
yury
0c6fb09094 * fixed compilation for wince.
git-svn-id: trunk@7517 -
2007-05-29 17:03:03 +00:00
micha
6c85fcb157 heap manager: initialize critical sections properly
git-svn-id: trunk@7412 -
2007-05-21 17:08:28 +00:00
micha
7f2a257102 + heap manager now per thread, reduce heap lock contention
+ heap threading test

git-svn-id: trunk@7407 -
2007-05-20 20:58:12 +00:00
micha
702685717f * cleanup of rtlevents, remove startwait due to persistance guarantee
git-svn-id: trunk@5854 -
2007-01-08 19:11:07 +00:00
Jonas Maebe
0c3afc0cf4 + implementation of cSemaphore* and BasicRTLEvent based on
sem_open/sem_close for Darwin (doesn't have sem_init/sem_destroy)
  + implementation of cSemaphore* based on pipes (for potential future
    systems that don't have either sem* routines)
  + test for basicrtlevent
  * fixed datarace whereby a TThread could be started, run and exit before
    TThread.AfterConstructor had been called (Mantis 6693, all platforms)
  * throw EThread exceptions in TThread.create if something during creating
    the tthread goes wrong (*nix)
  * don't crash in TThread.Destroy if the TThread throws an exception before
    it was fully initialised (*nix)
  * changed order of operations in TThread.Destroy so it doesn't perform
    invalid thread operations in some edge cases (*nix)
  * fixed usage of sem_wait/sem_trywait (can be interrupted) in Semaphore
    and RTLEvent implementations
  * fixed erroneous waiting for threads after they had already exited via
    pthread_detach/pthread_exit
  * fixed several memory leaks in case of thread intialisation errors
    (*nix)
  * unified tthread.inc for all Unices

git-svn-id: trunk@5662 -
2006-12-21 18:22:47 +00:00
florian
fd2032dab2 + start of embedded rtl
+ feature support in the compiler

git-svn-id: trunk@5628 -
2006-12-17 18:40:36 +00:00
Almindor
2ee7e64a4a * adds semaphore support to ThreadManager, removes pipe hack from non linux
+ adds SemaphoreInit, SemaphorePost, SemaphoreWait and SemaphoreDestroy to TM

git-svn-id: trunk@4900 -
2006-10-14 11:39:47 +00:00
florian
262f60e67d * flush std handlers at thread termination
git-svn-id: trunk@4752 -
2006-09-28 20:36:41 +00:00
tom_at_work
1b4b42fdd6 * added CheckInitialStkLen() function which checks whether the given stack size value is valid on the OS when creating a thread, fixing stack checking
git-svn-id: trunk@1722 -
2005-11-11 12:16:08 +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
florian
7bff61ce29 * patch from Ales Katona to add a stack size parameter to tthread functions
git-svn-id: trunk@1621 -
2005-11-01 22:01:48 +00:00
florian
ad3b9b9464 * windows rtl restructuring to share code between win32 and win64
* BeginThread can take a qword on 64 bit targets as stacksize

git-svn-id: trunk@287 -
2005-06-08 19:08:49 +00:00
peter
4ace790492 * remove $Log
git-svn-id: trunk@231 -
2005-06-07 09:47:55 +00:00
Jonas Maebe
7ba46ce6f0 * Darwin TThreadID is a pointer
* BeginThread now returns a TThreadID instead of dword

git-svn-id: trunk@189 -
2005-06-04 09:33:39 +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
Tomas Hajny
226b1ff3a7 * two more (TThreadID) 2005-04-20 07:41:48 +00:00
Tomas Hajny
787bd9171d * one more TThreadID fix 2005-04-17 17:19:41 +00:00
florian
c04f0bc856 * fixed more TThreadID stuff 2005-04-14 20:42:14 +00:00
florian
3ab66b5576 * TThread on linux fixed 2005-04-13 20:15:47 +00:00
florian
710dbcef0a + classes.mainthreadid is set now
+ rtleventresetevent
  + rtleventwairfor with timeout
  + checksynchronize with timeout
  * race condition in synchronize fixed
2005-04-09 17:26:08 +00:00
florian
d18746bd15 * proper error message if the cthreads unit is included too late
uses clause
2005-04-03 19:29:28 +00:00
florian
c7939907f0 * rtl event init/destroy throws only an error if it's used in a mult threaded program 2005-02-26 11:40:38 +00:00
florian
98106e588c * another "transfer to linux"-commit 2005-02-25 22:02:46 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
peter
c96f69718f can't use resourcestrings in the system unit 2005-02-07 17:36:54 +00:00
peter
2fbaae2b91 * threading in system unit
* removed systhrds unit
2005-02-06 11:20:52 +00:00
armin
690e3330d1 * applied patch to compile go32v2 from Tomas (tested by John) 2005-01-21 21:43:12 +00:00
florian
9255d0d90b * critical sections can be used in programs without threading driver, they have no effect then 2005-01-16 14:46:57 +00:00
marco
e12796a400 * tthread patch from neli 2004-12-28 14:20:03 +00:00
marco
cb75ebda02 * checksynchronize now in interface win32 uses the default impl.
unix uses systhrds, rest empty implementation.
2004-12-27 15:28:40 +00:00
peter
9d567a3c63 * fix rtlcreateevent 2004-12-23 20:58:22 +00:00
marco
7377bbf1c9 * 2nd synchronize attempt. cthreads<->systhrds difference was not ok, but
only showed on make install should be fixed now.
2004-12-23 15:08:58 +00:00