integer(localsynclist) := interlockedexchange(integer(synclist), integer(localsynclist));
try
result := (localsynclist <> nil) and (localsynclist.count > 0);
if result then
begin
while localsynclist.count > 0 do
begin
syncproc := localsynclist[0];
localsynclist.delete(0);
leavecriticalsection(threadlock);
try
try
syncproc.syncrec.fmethod;
except
syncproc.syncrec.fsynchronizeexception := acquireexceptionobject;
end;
finally
entercriticalsection(threadlock);