From: Philippe Gerum <rpm@xenomai.org>
To: Dmitry Adamushko <dmitry.adamushko@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] [pipe.c] hairy synchronization -> "flush the output queue upon closure"
Date: Sun, 20 Nov 2005 11:20:28 +0100 [thread overview]
Message-ID: <43804DEC.8030805@domain.hid> (raw)
In-Reply-To: <OFCFB2F55F.EFC474AA-ONC12570BD.00453247-C12570BD.0045E0FD@datacon.at>
Dmitry Adamushko wrote:
> Philippe Gerum <rpm@xenomai.org> wrote on 18.11.2005 12:07:22:
>
> >
> > > Hm.. but we still have fasync_helper(-1,file,0,&state->asyncq);
> which is
> > > about sending a signal and that's perfectly valid (a file::counter is
> > > not involved here). And that call may lead to re-scheduling (linux
> > > re-scheduling of course) so we can't put it in a blocked section.
> > >
> > > So the best way I see is to have something like():
> > >
> > > xnpipe_drop_user_conn()
> > > {
> > > xnlock_get_irqsave(&nklock,s);
> > >
> > > while ((holder = getq(&state->outq)) != NULL)
> > >
> > > state->output_handler(minor,link2mh(holder),-EPIPE,state->cookie);
> > > }
> > >
> > > while ((holder = getq(&state->inq)) != NULL)
> > > {
> > > if (state->input_handler != NULL)
> > >
> > > state->input_handler(minor,link2mh(holder),-EPIPE,state->cookie);
> > > else if (state->alloc_handler == NULL)
> > > xnfree(link2mh(holder));
> > > }
> > >
> > > __clrbits(state->status,XNPIPE_USER_CONN);
> > >
> > > xnlock_put_irqrestore(&nklock,s);
> > > }
> > >
> > > and call it everywhere instead of
> clrbits(state->status,XNPIPE_USER_CONN);
> > >
> > > This way we may be sure there are no pending messages left.
> > >
> > >
> >
> > Sounds consistent, since USER_CONN flag is semantically bound to the
> > active/inactive state
> > of the associated data queues anyway.
> >
>
> Then a patch is enclosed.
>
Applied, thanks.
>
> > --
> >
> > Philippe.
>
> ---
>
> Dmitry
>
>
> /(See attached file: pipe.cleanup-user-conn.patch)//(See attached file:
> ChangeLog-diff.patch)/
>
--
Philippe.
next prev parent reply other threads:[~2005-11-20 10:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-18 9:43 [Xenomai-core] [pipe.c] hairy synchronization -> "flush the output queue upon closure" Dmitry Adamushko
2005-11-18 9:58 ` Dmitry Adamushko
2005-11-18 10:14 ` Philippe Gerum
2005-11-18 10:17 ` Philippe Gerum
2005-11-18 10:43 ` Dmitry Adamushko
2005-11-18 11:07 ` Philippe Gerum
2005-11-18 12:43 ` Dmitry Adamushko
2005-11-20 10:20 ` Philippe Gerum [this message]
2005-11-18 11:53 ` Sebastian Smolorz
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=43804DEC.8030805@domain.hid \
--to=rpm@xenomai.org \
--cc=dmitry.adamushko@domain.hid \
--cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.