&& get_ttyp ()->pty_input_state_eq (tty::to_nat))
{
WaitForSingleObject (input_mutex, mutex_timeout);
+ acquire_attach_mutex (mutex_timeout);
transfer_input (tty::to_cyg, get_handle_nat (), get_ttyp (),
input_available_event);
+ release_attach_mutex ();
ReleaseMutex (input_mutex);
}
if (get_ttyp ()->master_is_running_as_service
&& get_ttyp ()->switch_to_nat_pipe)
{
WaitForSingleObject (input_mutex, mutex_timeout);
+ acquire_attach_mutex (mutex_timeout);
transfer_input (tty::to_cyg, get_handle_nat (), get_ttyp (),
input_available_event);
+ release_attach_mutex ();
ReleaseMutex (input_mutex);
}
}
WaitForSingleObject (input_mutex, mutex_timeout);
if (get_ttyp ()->switch_to_nat_pipe && !get_ttyp ()->pcon_activated
&& get_ttyp ()->pty_input_state_eq (tty::to_nat))
- transfer_input (tty::to_cyg, get_handle_nat (), get_ttyp (),
- input_available_event);
+ {
+ acquire_attach_mutex (mutex_timeout);
+ transfer_input (tty::to_cyg, get_handle_nat (), get_ttyp (),
+ input_available_event);
+ release_attach_mutex ();
+ }
ReleaseMutex (input_mutex);
/* Clean up nat pipe state */
get_ttyp ()->pty_input_state = tty::to_cyg;
if (!!masked != mask && xfer && (need_gdb_xfer || need_xfer))
{
if (mask && get_ttyp ()->pty_input_state_eq (tty::to_nat))
- transfer_input (tty::to_cyg, get_handle_nat (), get_ttyp (),
- input_available_event);
+ {
+ acquire_attach_mutex (mutex_timeout);
+ transfer_input (tty::to_cyg, get_handle_nat (), get_ttyp (),
+ input_available_event);
+ release_attach_mutex ();
+ }
else if (!mask && get_ttyp ()->pty_input_state_eq (tty::to_cyg))
- transfer_input (tty::to_nat, get_handle (), get_ttyp (),
- input_available_event);
+ {
+ acquire_attach_mutex (mutex_timeout);
+ transfer_input (tty::to_nat, get_handle (), get_ttyp (),
+ input_available_event);
+ release_attach_mutex ();
+ }
}
ReleaseMutex (input_mutex);
}
if (get_readahead_valid ())
accept_input ();
WaitForSingleObject (input_mutex, mutex_timeout);
+ acquire_attach_mutex (mutex_timeout);
fhandler_pty_slave::transfer_input (tty::to_nat, from_master,
get_ttyp (),
input_available_event);
+ release_attach_mutex ();
ReleaseMutex (input_mutex);
}
get_ttyp ()->pcon_start_pid = 0;
non-cygwin app is terminated if pseudo console is disabled. */
if (to_be_read_from_nat_pipe () && !get_ttyp ()->pcon_activated
&& get_ttyp ()->pty_input_state == tty::to_cyg)
- fhandler_pty_slave::transfer_input (tty::to_nat, from_master,
- get_ttyp (), input_available_event);
+ {
+ acquire_attach_mutex (mutex_timeout);
+ fhandler_pty_slave::transfer_input (tty::to_nat, from_master,
+ get_ttyp (), input_available_event);
+ release_attach_mutex ();
+ }
ReleaseMutex (input_mutex);
line_edit_status status = line_edit (p, len, ti, &ret);
&& stdin_is_ptys && get_ttyp ()->pty_input_state_eq (tty::to_cyg))
{
WaitForSingleObject (input_mutex, mutex_timeout);
+ acquire_attach_mutex (mutex_timeout);
transfer_input (tty::to_nat, get_handle (), get_ttyp (),
input_available_event);
+ release_attach_mutex ();
ReleaseMutex (input_mutex);
}
}
&& ttyp->pty_input_state_eq (tty::to_nat))
{
WaitForSingleObject (p->input_mutex, mutex_timeout);
+ acquire_attach_mutex (mutex_timeout);
transfer_input (tty::to_cyg, p->from_master_nat, ttyp,
p->input_available_event);
+ release_attach_mutex ();
ReleaseMutex (p->input_mutex);
}
WaitForSingleObject (p->pipe_sw_mutex, INFINITE);
&& get_ttyp ()->pty_input_state_eq (tty::to_cyg))
{
WaitForSingleObject (input_mutex, mutex_timeout);
+ acquire_attach_mutex (mutex_timeout);
transfer_input (tty::to_nat, get_handle (), get_ttyp (),
input_available_event);
+ release_attach_mutex ();
ReleaseMutex (input_mutex);
}
else if (was_nat_fg && !nat_fg && get_ttyp ()->switch_to_nat_pipe
resume_pid = attach_console_temporarily (target_pid);
attach_restore = true;
}
+ else
+ acquire_attach_mutex (mutex_timeout);
WaitForSingleObject (input_mutex, mutex_timeout);
transfer_input (tty::to_cyg, from, get_ttyp (), input_available_event);
ReleaseMutex (input_mutex);
if (attach_restore)
resume_from_temporarily_attach (resume_pid);
+ else
+ release_attach_mutex ();
}
ReleaseMutex (pipe_sw_mutex);
}