Commit e2e9bf9c authored by Georg Brandl's avatar Georg Brandl

Clarify thread.join() docs. #1873.

parent 8aced952
...@@ -622,18 +622,19 @@ impossible to detect the termination of alien threads. ...@@ -622,18 +622,19 @@ impossible to detect the termination of alien threads.
When the *timeout* argument is present and not ``None``, it should be a floating When the *timeout* argument is present and not ``None``, it should be a floating
point number specifying a timeout for the operation in seconds (or fractions point number specifying a timeout for the operation in seconds (or fractions
thereof). As :meth:`join` always returns ``None``, you must call thereof). As :meth:`join` always returns ``None``, you must call :meth:`isAlive`
:meth:`isAlive` to decide whether a timeout happened. after :meth:`join` to decide whether a timeout happened -- if the thread is
still alive, the :meth:`join` call timed out.
When the *timeout* argument is not present or ``None``, the operation will block When the *timeout* argument is not present or ``None``, the operation will block
until the thread terminates. until the thread terminates.
A thread can be :meth:`join`\ ed many times. A thread can be :meth:`join`\ ed many times.
:meth:`join` may throw a :exc:`RuntimeError`, if an attempt is made to join the :meth:`join` raises a :exc:`RuntimeError` if an attempt is made to join
current thread as that would cause a deadlock. It is also an error to the current thread as that would cause a deadlock. It is also an error to
:meth:`join` a thread before it has been started and attempts to do so raises :meth:`join` a thread before it has been started and attempts to do so
same exception. raises the same exception.
.. method:: Thread.getName() .. method:: Thread.getName()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment