delphi中的线程类
猛禽[mental studio]
http://mental.mentsu.com
之五(大结局)
回到前面checksynchronize,见下面的代码:
function checksynchronize(timeout: integer = 0): boolean;
var
syncproc: psyncproc;
localsynclist: tlist;
begin
if getcurrentthreadid <> mainthreadid then
raise ethread.createresfmt(@schecksynchronizeerror, [getcurrentthreadid]);
if timeout > 0 then
waitforsyncevent(timeout)
else
resetsyncevent;
localsynclist := nil;
entercriticalsection(threadlock);
try