Migrate certain runtime flags to atomics hidden behind functions

This commit is contained in:
ridiculousfish
2019-05-12 15:48:00 -07:00
parent 4fcb9d1fed
commit c44dae2d73
10 changed files with 58 additions and 38 deletions

View File

@@ -1031,10 +1031,11 @@ static void test_cancellation() {
// Test for #3780
// Ugly hack - temporarily set is_interactive_session
// else we will SIGINT ourselves in response to our child death
scoped_push<bool> iis(&is_interactive_session, true);
bool iis = is_interactive_session();
set_interactive_session(true);
const wchar_t *child_self_destructor = L"while true ; sh -c 'sleep .25; kill -s INT $$' ; end";
parser_t::principal_parser().eval(child_self_destructor, io_chain_t(), TOP);
iis.restore();
set_interactive_session(iis);
// Restore signal handling.
proc_pop_interactive();