- This topic has 1 reply, 2 voices, and was last updated 4 years, 10 months ago by .
Viewing 1 reply thread
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Nested execution of the BeginWrite method, the program will freeze.
eg.
FLock: TkbmMWLock;
FLock.BeginWrite;
try
…
FLock.BeginWrite;
try
…
finally
FLock.EndWrite;
end;
finally
FLock.EndWrite;
end;
Delphi 10.3.3
kbmMW 5.13.00
Hi,
It definitely will not block. kbmMWLock supports nested locking, both for reader and writer. But do you do something in the … parts that may synchronize with the VCL thread (a typical mistake)?
This simple code runs perfectly:
procedure TForm2.FormCreate(Sender: TObject);
var
FLock:TkbmMWLock;
begin
FLock:=TkbmMWLock.Create;
try
FLock.BeginWrite;
try
FLock.BeginWrite;
try
finally
FLock.EndWrite;
end;
finally
FLock.EndWrite;
end;
finally
FLock.Free;
end;
end;