Hi The TMultiReadExclusiveWriteSynchronizer implementation does not allow "read lock" promoting to a "write lock". The program above hang in FPC 2.4 and 2.5.x while working in Delphi and FPC 2.2.x. It hangs at the "x.Beginwrite();" instruction. The implementation clearly does not support this scenario. It will be helpfull to note this in the documentation.
<code> program test; {$mode objfpc}{$H+} uses SysUtils; var x : TMultiReadExclusiveWriteSynchronizer; begin x := TMultiReadExclusiveWriteSynchronizer.Create(); x.Beginread(); WriteLn('Beginread'); x.Beginwrite(); WriteLn('Beginwrite'); x.Endwrite(); WriteLn('Endwrite'); x.Endread(); WriteLn('Endread'); ReadLn; end. </code> -- Inoussa O. _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel