public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Takashi Yano <tyan0@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: console: Add attach_mutex guard that was not added.
Date: Fri, 18 Mar 2022 14:30:37 +0000 (GMT)	[thread overview]
Message-ID: <20220318143037.2E72B3858D3C@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=8d3271b7fa4ceed4825ce125123b75447ef18d53

commit 8d3271b7fa4ceed4825ce125123b75447ef18d53
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Fri Mar 18 23:28:36 2022 +0900

    Cygwin: console: Add attach_mutex guard that was not added.

Diff:
---
 winsup/cygwin/fhandler_console.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index b92d758d1..68248d16c 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -362,7 +362,9 @@ remove_record:
 		  {
 		    if (total_read + j - i >= n)
 		      { /* Something is wrong. Giving up. */
+			acquire_attach_mutex (mutex_timeout);
 			WriteConsoleInputW (p->input_handle, tmp, n, &n);
+			release_attach_mutex ();
 			goto skip_writeback;
 		      }
 		    input_rec[total_read + j - i] = tmp[j];


                 reply	other threads:[~2022-03-18 14:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220318143037.2E72B3858D3C@sourceware.org \
    --to=tyan0@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).