Hallo,
Ich hätte dann noch eine Frage..
Kann ich CriticalSections lokal definieren? d.h. :
Delphi-Quellcode:
procedure Dummy;
var cs: TCriticalSection;
begin
cs := TCriticalSection.Create;
try
Cmd1;
cs.Enter;
try
Cmd2;
Cmd3;
finally
cs.Leave;
end;
finally
cs.Free;
end;
end;
//Thread1
procedure Thread1;
begin
while true do Dummy;
end;
//Thread2
procedure Thread2;
begin
while true do Dummy;
end;
Würde das gehn?
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."