mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Maksim (Max) Krasnyanskiy" <maxk@qualcomm.com>
To: "James Stevenson" <mistral@stev.org>,
	"Kevin Curtis" <kevin.curtis@farsite.co.uk>,
	<linux-kernel@vger.kernel.org>
Subject: Re: Closing a socket
Date: Thu, 18 Jul 2002 12:50:48 -0700	[thread overview]
Message-ID: <5.1.0.14.2.20020718124601.0910ba78@mail1.qualcomm.com> (raw)
In-Reply-To: <001701c22e85$240635b0$0501a8c0@Stev.org>


> > I have implemented a new socket address family and have noted that
> > from a multi-threaded application, if a thread calls close(fd) while a
> > second thread has a blocking read outstanding, the sockets release() is not
> > called.  Is this correct?  How can one unblock the read in order to do the
> > close.
You might want to implement shutdown(). Thread #1 will call shutdown() 
instead of
the close(). Your shutdown() implementation can do something like:
         sk->shutdown |= RCV_SHUTDOWN;
         sk->state_change(sk);
So, reader will wakeup, check shutdown mask and return error because socket was
shut down.

Max



      reply	other threads:[~2002-07-18 19:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-18 16:36 Kevin Curtis
2002-07-18 18:01 ` James Stevenson
2002-07-18 19:50   ` Maksim (Max) Krasnyanskiy [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=5.1.0.14.2.20020718124601.0910ba78@mail1.qualcomm.com \
    --to=maxk@qualcomm.com \
    --cc=kevin.curtis@farsite.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mistral@stev.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

all inboxes | Powered by JetHome®