Delphi中的线程类--之(4)[11]

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

本文简介:选择自 raptor 的 blog

  try

    with message do

      case msg of

        wm_null:

          checksynchronize;

  except

    handleexception(self);

  end;

end;

其中的checksynchronize也是定义在classes单元中的,由于它比较复杂,暂时不详细说明,只要知道它是具体处理synchronize功能的部分就好,现在继续分析synchronize的代码。

在执行完wakemainthread事件后,就退出临界区,然后调用waitforsingleobject开始等待在进入临界区前创建的那个event。这个event的功能是等待这个同步方法的执行结束,关于这点,在后面分析checksynchronize时会再说明。

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

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

go top