www.digitalmars.com         C & C++   DMDScript  

D - Thread.wait()

reply "Matthew Wilson" <dmd synesis.com.au> writes:
Maize
The documentation for Thread says:

void wait();
Wait for this thread to terminate. Throws ThreadError if the thread hasn't
begun yet or has already terminated or is called on itself
Thankfully these are not the semantics apparent in thread.d.

    void wait()
    {
     if (this === getThis())
         error("wait on self");
     if (state == TS.RUNNING)
     {   DWORD dw;
         dw = WaitForSingleObject(hdl, 0xFFFFFFFF);
     }
    }

Presumably the doc is just out-of-date. Is this correct?
Apr 12 2003
parent "Walter" <walter digitalmars.com> writes:
I think the doc is wrong.

"Matthew Wilson" <dmd synesis.com.au> wrote in message
news:b7aftr$s24$1 digitaldaemon.com...
 Maize
 The documentation for Thread says:

 void wait();
 Wait for this thread to terminate. Throws ThreadError if the thread hasn't
 begun yet or has already terminated or is called on itself
 Thankfully these are not the semantics apparent in thread.d.

     void wait()
     {
      if (this === getThis())
          error("wait on self");
      if (state == TS.RUNNING)
      {   DWORD dw;
          dw = WaitForSingleObject(hdl, 0xFFFFFFFF);
      }
     }

 Presumably the doc is just out-of-date. Is this correct?
Apr 19 2003