Commit Graph

19 Commits

Author SHA1 Message Date
michael
8dd254b281 * Fixed synchronize/waitfor issue
git-svn-id: trunk@16145 -
2010-10-12 18:08:24 +00:00
Jonas Maebe
d7cdd9afba * allow tthread-based threads to only start executing once the constructor
has finished running (based on patch by Jared Davison, mantis #16884)

git-svn-id: trunk@15599 -
2010-07-18 16:31:25 +00:00
Jonas Maebe
b214448b9e * don't access the thread instance after calling DoTerminate to avoid
race conditions in case DoTerminate can cause the thread to be freed
    already. Side-effect: changing FreeOnTerminate in DoTerminate no longer
    has any effects, but this is compatible with the generic code for
    ThreadProc in objpas/classes/classes.inc (patch by Nikolai ZHUBR)

git-svn-id: trunk@14504 -
2009-12-30 14:46:56 +00:00
Jonas Maebe
8349cde7db * changed byte/word/longbool to be Delphi-compatible (+ similar changes
for qwordbool) + test:
    o assigning true to such a variable now sets them to $ff/$ffff/$ffffffff
    o these types are now all signed
    o converting an integer type to a byte/word/long/qwordbool using an
      explicit type cast keeps the integer's original value stored in the
      bool, instead of forcing it to ord(true)/ord(false)
    (mantis #10233 and #10613, implemented for all architectures, testsuite
     tested for ppc32, sparc and x86)
  * fixed some places where the rtl depended on longbool(true) having the
    value 1
  * extended several boolean tests (and adapted some to no longer assume
    that byte/word/long/qwordbool(true)=1)
  + support for converting to qwordbool in second_int_to_bool for x86, ppc
    and sparc

git-svn-id: trunk@9898 -
2008-01-24 21:30:55 +00:00
Jonas Maebe
4e78a30ee3 * only print exception backtrace at end of unhandled exception in
tthread in case rtl is compiled with -dDEBUG_MT

git-svn-id: trunk@8595 -
2007-09-21 15:09:08 +00:00
Jonas Maebe
f3a00b0731 * cache result of GetThreadManager in InitThreads
git-svn-id: trunk@8245 -
2007-08-08 11:33:54 +00:00
micha
dd350255a4 * print thread handle unsigned in unix thread debug info
git-svn-id: trunk@8094 -
2007-07-18 20:14:48 +00:00
micha
721ae51cd0 * dump stack when thread terminates because of exception (unix)
git-svn-id: trunk@8093 -
2007-07-18 20:13:39 +00:00
Jonas Maebe
172f85c8c3 * fixed important typo in better comments :)
git-svn-id: trunk@7618 -
2007-06-09 20:37:26 +00:00
Jonas Maebe
e93d612f4a * fixed FFreeOnTerminate handing in destructor + better comments
git-svn-id: trunk@7617 -
2007-06-09 20:36:35 +00:00
Jonas Maebe
4dd3be0e5a * return thread function result via pthread_exit() from CBeginThread
(Vinzent Hoefler)
  * simplified CWaitForThreadTerminate based on comments from Vinzent
    Hoefler
  * fixed resource leaks where in some cases a pthread would not be
    reaped based on comments from Vinzent Hoefler (resolves #9016)

git-svn-id: trunk@7588 -
2007-06-06 15:18:48 +00:00
Jonas Maebe
526a79a3c6 * disable thread suspension from another thread under *nix, see added
comments in cthreads.pp why

git-svn-id: trunk@7551 -
2007-06-02 11:39:59 +00:00
Jonas Maebe
157e5eb02e * fixed debug code for 64 bit
git-svn-id: trunk@5913 -
2007-01-12 09:12:13 +00:00
Jonas Maebe
652d331922 * fixed 64 bit compilation
git-svn-id: trunk@5680 -
2006-12-22 16:50:09 +00:00
Jonas Maebe
cf4b3f2e4d * don't destroy fsem in tthread.destroy before its potential last use
git-svn-id: trunk@5678 -
2006-12-22 14:53:54 +00:00
Jonas Maebe
4cbbfd7f5c * set FSuspended also if a tthread is suspended by an external thread
on unix
  * fixed some dataraces in unix' suspend/resume (although they can't
    be solved completely due to no possibility to atomically
    suspend/resume and set fsuspended at the same time)

git-svn-id: trunk@5677 -
2006-12-22 14:49:49 +00:00
Jonas Maebe
1867a46f34 - disabled fix for mantis 6693 from r5662 since the fix itself also
contains a race condition

git-svn-id: trunk@5670 -
2006-12-21 23:11:35 +00:00
Jonas Maebe
96b379ab0b * fixed initial suspending bug in r5662
git-svn-id: trunk@5668 -
2006-12-21 21:51:41 +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