| 271 | void ParentAfterFork() { mutex_.unlock(); } |
| 272 | |
| 273 | void ChildAfterFork() { |
| 274 | new (&mutex_) std::mutex; |
| 275 | // Leak previous thread, as it has become invalid. |
| 276 | // We can't spawn a new one here as it would have unfortunate side effects; |
| 277 | // especially in the frequent context of a fork+exec. |
| 278 | // (for example the Python subprocess module closes all fds before calling exec) |
| 279 | ARROW_UNUSED(signal_receiving_thread_.release()); |
| 280 | // Make internal state consistent: with no listening thread, we shouldn't |
| 281 | // feed the self-pipe from the signal handler. |
| 282 | UnregisterHandlers(); |
| 283 | } |
| 284 | |
| 285 | std::mutex mutex_; |
| 286 | std::vector<SavedSignalHandler> saved_handlers_; |