multithreading - TThreadList and "with" statement -
just short question regarding how use tthreadlist. safe use "with" statement follows:
fenginelist.daqengines.locklist begin try idx := 0 count - 1 items[idx].param1 := cos(2*pi*i/count); ... ... fenginelist.daqengines.unlocklist; end; end; or should explicitly here:
uengines := fenginelist.daqengines.locklist; try uengines begin idx := 0 count - 1 items[idx].param1 := cos(2*pi*i/count); ... ... end; fenginelist.daqengines.unlocklist; end; thanks!
it's upon variant choose. with tells compiler get members write in code. yes, safe, long you're accessing members wanted to. doesn't affect runtime.
i prefer first way, without begin..end block (if i'd forced use with), it's personal preference , free write wish:
with fenginelist.daqengines.locklist try ... fenginelist.daqengines.unlocklist; end;
Comments
Post a Comment