| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I plan on revisiting this problem, to introduce a better long-term solution. However, that probably won't be in 3.12. |
Sorry, something went wrong.
|
Ae you still going with this, or has it been superseded? |
Sorry, something went wrong.
|
It's superseded for the moment. I'm likely to revisit this for 3.13. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
(This should solve the semi-frequent buildbot failures we've been seeing.)
In Py_EndInterpreter() we almost immediately wait for all non-daemon Python threads to finish, by calling theading._shutdown(). However, with a per-interpreter GIL there's a race because threading._shutdown() doesn't wait long enough. This change fixes that by making sure _PyThreadState_DeleteCurrent() completely finishes before releasing the lock on which threading._shutdown() depends.
The gist of it is that we release that lock (and clean it up) later than we would normally be able to, by doing the cleanup in another thread via a "pending" call.
This isn't an ideal solution, but other approaches I tried involved more invasive changes, which I'd like to avoid this close to the beta 1 release.