public inbox for
 help / color / mirror / Atom feed
From: Will Bryant <>
Subject: Re: problem using pthread_cancel and pthread_mutex_lock
Date: Wed, 10 Mar 2004 00:57:00 -0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Simon,

I've been using this technique in my apps and it works well.

Unfortunately however select() seems to be buggy, from my reading of the
docs it should act exactly the same way, ie. it should return as soon as
the socket is shutdown() - but it doesn't :(.

This is a bit of a problem as it's select as AFAIK only way to get
proper timeout behaviour on Windows...


Simon Gerblich wrote:

>Hi Viv,
>I'm also writing code that we compile with redhat linux and pthreads-win32.
>I get around your socket problem by having a tcp network class that does the
>read(), write() calls etc.  recv() will return with an error if you call
>and close()/closesocket() on the socket.
>I have a call to shutdown() and close()/closesocket() in the destructor of
>the class.
>It works well for us.
>Maybe you could call shutdown() and close()/closesocket() instead of
>"killing the thread", and the recv() call will return and the thread can

  reply	other threads:[~2004-03-10  0:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-09 23:25 Simon Gerblich
2004-03-10  0:57 ` Will Bryant [this message]
2004-03-10 11:11 ` vc
  -- strict thread matches above, loose matches on Subject: below --
2004-02-24  4:23 Simon Gerblich
2004-02-26 15:59 ` vc
2004-02-23 17:43 vc
2004-03-01 16:27 ` vc
2004-03-04 23:13   ` Ross Johnson
2004-03-09 14:06     ` vc
2004-03-09 14:15     ` Brano Kemen
2004-03-09 15:09       ` Panagiotis E. Hadjidoukas
2004-03-09 15:42         ` Brano Kemen

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:

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

  git send-email \ \ \ \

* 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).