19.11.2014 Views

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 28<br />

Threads<br />

28.1 <strong>The</strong> Trait <strong>Fortress</strong>.Standard.Thread<br />

Every thread in <strong>Fortress</strong> has trait Thread.<br />

trait Thread<br />

valT():T<br />

wait():()<br />

ready():Boolean<br />

stop():() throws Stopped<br />

end<br />

28.1.1 valT():T<br />

<strong>The</strong> val method returns the value computed by the expression of the thread. If the thread has not yet completed<br />

execution, the invocation of val blocks until it has done so.<br />

28.1.2 wait():()<br />

<strong>The</strong> wait method waits for a thread to complete, but does not return a value.<br />

28.1.3 ready():Boolean<br />

<strong>The</strong> ready method returns true if a thread has completed, and returns false otherwise.<br />

28.1.4 stop():() throws Stopped<br />

<strong>The</strong> stop method attempts to terminate a thread.<br />

206

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!