* 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 -
* 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 -
* InternalExit: now calls new procedure SysFlushStdIO
* DoneThread: Also calls SysFlushStdIO to avoid loosing output
if standard files are redirected.
git-svn-id: trunk@17798 -
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 -
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 -
(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 -
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 -
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 -
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 -