Skip to content

Commit

Permalink
Cygwin: console: Avoid slipping past disable_master_thread check.
Browse files Browse the repository at this point in the history
If disable_master_thread flag is set between the code checking that
flag not be set and the code acquiring input_mutex, input record is
processed once after setting disable_master_thread flag. This patch
prevents that.

Backported-from: 9bcfd06 (Cygwin: console: Avoid slipping past disable_master_thread check., 2024-02-03)
Fixes: d4aacd5 ("Cygwin: console: Add missing input_mutex guard.")
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
tyan0 authored and dscho committed Mar 3, 2024
1 parent 314b48a commit bd1dc4f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions winsup/cygwin/fhandler/console.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4351,8 +4351,6 @@ fhandler_console::set_disable_master_thread (bool x, fhandler_console *cons)
else
return;
}
if (con.disable_master_thread == x)
return;
cons->acquire_input_mutex (mutex_timeout);
con.disable_master_thread = x;
cons->release_input_mutex ();
Expand Down

0 comments on commit bd1dc4f

Please sign in to comment.