Message197177
New patch threadstate_join_5.patch adds more testing of is_alive().
An inelegance I don't care about (but someone might): if join() is called with a timeout, and the Python part of the thread ends before the timeout expires (_stopped gets set), then a _non_-blocking attempt to acquire _tstate_lock is made, and join() returns regardless of the outcome. So, with a timeout, it's possible for join() to return before the C part of the thread is done even if the timeout isn't yet exhausted.
That's unlikely, and I don't see that it makes any difference. Anyone doing a join() with a timeout has to be aware that they have no idea whether the thread is done when join() returns, and do another join() or check is_alive() later.
I'd rather not complicate the code to wait longer for _tstate_lock in this case. |
|
Date |
User |
Action |
Args |
2013-09-07 18:32:01 | tim.peters | set | recipients:
+ tim.peters, jcea, csernazs, ncoghlan, pitrou, grahamd, neologix, python-dev, Tamas.K |
2013-09-07 18:32:00 | tim.peters | set | messageid: <1378578720.98.0.225343898764.issue18808@psf.upfronthosting.co.za> |
2013-09-07 18:32:00 | tim.peters | link | issue18808 messages |
2013-09-07 18:32:00 | tim.peters | create | |
|