From: Jeremy Drake <cygwin@jdrake.com>
To: Takashi Yano <takashi.yano@nifty.ne.jp>
Cc: cygwin-patches@cygwin.com
Subject: Re: [PATCH v4] Cygwin: pipe: Avoid deadlock for non-cygwin writer.
Date: Tue, 29 Mar 2022 08:40:19 -0700 (PDT) [thread overview]
Message-ID: <alpine.BSO.2.21.2203290837290.56460@resin.csoft.net> (raw)
In-Reply-To: <20220329090753.47207-1-takashi.yano@nifty.ne.jp>
On Tue, 29 Mar 2022, Takashi Yano wrote:
> diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
> index b87160edb..006c7b4bf 100644
> --- a/winsup/cygwin/fhandler.h
> +++ b/winsup/cygwin/fhandler.h
> @@ -1194,6 +1194,7 @@ private:
> HANDLE hdl_cnt_mtx;
> HANDLE query_hdl_proc;
> HANDLE query_hdl_value;
> + HANDLE query_hdl_close_req_evt;
> uint64_t pipename_key;
> DWORD pipename_pid;
> LONG pipename_id;
> @@ -1258,6 +1259,16 @@ public:
> }
> bool reader_closed ();
> HANDLE temporary_query_hdl ();
> + bool need_close_query_hdl ()
> + {
> + return query_hdl_close_req_evt ?
> + IsEventSignalled (query_hdl_close_req_evt) : false;
> + }
> + void request_close_query_hdl ()
> + {
> + if (query_hdl_close_req_evt)
> + SetEvent (query_hdl_close_req_evt);
> + }
> };
>
> #define CYGWIN_FIFO_PIPE_NAME_LEN 47
Oh, a minor optimization: should close_query_handle also close (and NULL)
the query_hdl_close_req_evt?
prev parent reply other threads:[~2022-03-29 15:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-29 9:07 Takashi Yano
2022-03-29 15:21 ` Jeremy Drake
2022-03-30 0:17 ` Takashi Yano
2022-04-01 8:44 ` Takashi Yano
2022-03-29 15:40 ` Jeremy Drake [this message]
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=alpine.BSO.2.21.2203290837290.56460@resin.csoft.net \
--to=cygwin@jdrake.com \
--cc=cygwin-patches@cygwin.com \
--cc=takashi.yano@nifty.ne.jp \
/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).