- changed status to resolved
dwsIOCPWorkerThreadPool.pas FLock.BeginRead in finally section ?
Issue #250
resolved
I just scrolled through the code and this line in the finally section dropped in my eyes
procedure TIOCPTask.Cancel;
var
tmp : TArray<IWorkerTask>;
begin
if Status = tsCanceled then Exit;
FLock.BeginRead;
try
tmp := Copy(FDependsTo, 0);
if FWaitEvent <> 0 then
SetEvent(FWaitEvent);
finally
FLock.BeginRead; // <------------------ shouldn't this FLock.EndRead; ?
end;
for var i := 0 to High(tmp) do
tmp[i].Cancel;
end;
Comments (1)
-
repo owner - Log in to comment
Yes, you're right, beyond the issue, the Cancel method is still essentially untested
(fixed by 48cf09756126e24e375e9e956d490b2d102e685a)