move try_sig_mask to separate file to avoid always loading POSIX #1023
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
POSIX is an extra module to load which many test scripts don't need themselves. Test2::Util was loading it for the try_sig_mask function, but this is only used in one place for the IPC mechanism. If the script isn't loading Test2::IPC or running with threads, it is not needed.
Move the try_sig_mask function to a separate module, and use the new module in Test2::IPC::Driver::Files. For backwards compatibility, maintain a try_sig_mask function in Test2::Util, but have it load and call the function in the new module. A new module is used rather than just delay loading POSIX, because for something involving threads or forks, loading at process start is preferrable.