Amir Aavani wrote:

 InitCriticalSection (cs);

 while true do
 begin
   EnterCriticalsection (cs);
   WriteLn ('Here!');
 end;
   LeaveCriticalsection (cs);

Each Enter.. must be matched by a Leave..., and you don't need the loop. The standard way of doing this is:

EnterCriticalsection (cs);
try
  WriteLn ('Here!');
finally
  LeaveCriticalsection (cs);
end;
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to