Delphi中的线程类--之(5,大结局)[2]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 raptor 的 blog

    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);

本文关键:Thread Event CriticalSection Synchronize
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top