Delphi中的线程类--之(2)[1]

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

本文简介:选择自 raptor 的 blog

delphi中的线程类

 

猛禽[mental studio]

http://mental.mentsu.com

 

之二

首先就是构造函数:

constructor tthread.create(createsuspended: boolean);

begin

  inherited create;

  addthread;

  fsuspended := createsuspended;

  fcreatesuspended := createsuspended;

  fhandle := beginthread(nil, 0, @threadproc, pointer(self), create_suspended, fthreadid);

  if fhandle = 0 then

    raise ethread.createresfmt(@sthreadcreateerror, [syserrormessage(getlasterror)]);

end;

虽然这个构造函数没有多少代码,但却可以算是最重要的一个成员,因为线程就是在这里被创建的。

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

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

go top