stripe / subprocess

A port of Python's subprocess module to Ruby
MIT License
208 stars 17 forks source link

Don't spawn a thread from inside the signal handler. #37

Closed nelhage-stripe closed 7 years ago

nelhage-stripe commented 7 years ago

This extra thread is causing issues with our CI infrastructure, which makes assertions that tests don't leak threads.

Instead, create a single self-pipe that the signal handler writes into; All communicate loops read from that pipe and then grab the mutex and rebroadcast the wakeup. Since they're running in normal threads, they can safely synchronize.

r? @andrew-stripe

andrew-stripe commented 7 years ago

Some implementation tweaks but no need to re-r. Make sure to bump the minor version again. I'm not sure if I'm pleased or angry at myself for suggesting this... maybe just angry at waitpid but nothing new there.

👍