◐ Shell
clean mode source ↗

closes bpo-38692: Add a pidfd child process watcher to asyncio. by benjaminp · Pull Request #17069 · python/cpython

@benjaminp

Well, I'm just reading the docstring you quoted. :)

Yeah, fair point. I had just misunderstood "callback() must be thread-safe", as the invocation and the callback itself must be thread-safe, rather than just the callback. I'm also the most familiar with ThreadedChildWatcher (since that one is the default), where multiple threads are utilized and loop.call_soon_threadsafe() is a must (within its _do_waitpid() method).

loop.call_soon_threadsafe(callback, pid, returncode, *args)