◐ Shell
clean mode source ↗

gh-137400: Stop the world when swapping profile functions by godlygeek · Pull Request #137472 · python/cpython

One thread's profile function or profile object can be changed from
another thread, for instance by `sys._setprofileallthreads`. This can
lead to crashes unless the two threads are synchronized. We need
a stop-the-world to ensure that the thread whose profile function or
profile object is being changed is in a state where it's not in the
middle of using either of those pointers.

Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>