| Home | Trees | Indices | Help |
|
|---|
|
|
Thread class with additional 'after' capability which runs a function after the thread is complete. This allows us to separate the notification from the computation.
Unlike Thread.join, the wait() method returns the value of the computation.
| Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
| Properties | |
|
name Thread name |
|
|
Inherited from |
|
| Method Details |
|
|
|
Wait for the thread to complete. Returns the result of the computation. Example: result = thread.wait() If timeout is used, then wait() may return before the result is available. In this case, wait() will return None. This can be used as follows:
while True:
result = thread.wait(timeout=0)
if result is not None: break
... do something else while waiting ...
Timeout should not be used with functions that may return None. This is due to the race condition in which the thread completes between the timeout triggering in wait() and the main thread calling thread.isAlive(). |
| Property Details |
nameThread name
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Mar 16 15:04:45 2009 | http://epydoc.sourceforge.net |