Commit Graph

13 Commits

Author SHA1 Message Date
Jonas Maebe
d5f415b047 * initialise fwritelocked and freadercount in the TMREWS constructor using
atomic operations so that in case it's created while multiple threads are
    already running, all threads are guaranteed to see this initialisation
  * some minor changes to the comments of TMREWS

git-svn-id: trunk@15074 -
2010-03-27 12:44:51 +00:00
Jonas Maebe
89e4e0fd25 * only wake up readers if all recursive write locks have been freed
git-svn-id: trunk@14831 -
2010-01-29 21:56:46 +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
e4858445c7 * make sure fwritelocked remains set correctly when using recursive write locks
git-svn-id: trunk@14828 -
2010-01-29 18:10:10 +00:00
Jonas Maebe
2c477269d0 * added a readbarrier after acquiring a read or write lock on
TMultiReadExclusiveWriteSynchronizer, to ensure that out-of-order
    execution cannot already perform some reads inside the critical section
    before the lock has been acquired
  - removed now unnecessary read barrier before releasing a read lock

git-svn-id: trunk@14820 -
2010-01-27 22:23:41 +00:00
Jonas Maebe
49f01e7b64 * replaced writelock of TMultiReadExclusiveWriteSynchronizer with a
critical section, so that it can be entered recursively just like
    the one from TSimpleRWSync + test
  - reverted r14593, since the reason for using TRWSync instead of
    TMultiReadExclusiveWriteSynchronizer was because the former
    supported recursive write locks

git-svn-id: trunk@14594 -
2010-01-10 12:14:21 +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
paul
9bad162368 rtl: fix crash in TMultiReadExclusiveWriteSynchronizer.Beginwrite
git-svn-id: trunk@14591 -
2010-01-10 09:35:37 +00:00
paul
538cf8667b rtl: fix compilation under windows
git-svn-id: trunk@14590 -
2010-01-10 06:28:50 +00:00
Jonas Maebe
8da0a031bf * fixed memory leak in new TMultiReadExclusiveWriteSynchronizer
(fwaitingwriterlock was not freed)
  * fixed typo in comment
  * free all memory in trwsync.pp test

git-svn-id: trunk@14588 -
2010-01-09 23:14:53 +00:00
Jonas Maebe
106baa8b2f * optimized version of TMultiReadExclusiveWriteSynchronizer that allows
concurrent readers (mantis #14451)

git-svn-id: trunk@14587 -
2010-01-09 23:00:45 +00:00
florian
d629426b67 + system qualifier added
git-svn-id: trunk@1187 -
2005-09-25 14:35:01 +00:00
florian
c7cd9ff06b * TMultiReadExclusiveWriteSynchronizer fixed and moved to SysUtils
git-svn-id: trunk@1164 -
2005-09-23 13:07:11 +00:00