From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26233 invoked by alias); 10 Mar 2004 00:57:23 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 26226 invoked from network); 10 Mar 2004 00:57:22 -0000 Received: from unknown (HELO serge.ecosm.com) (202.37.218.3) by sources.redhat.com with SMTP; 10 Mar 2004 00:57:22 -0000 Received: (qmail 22143 invoked by uid 503); 10 Mar 2004 00:57:20 -0000 Received: from sue.ecosm.com (HELO ecosm.com) (202.37.218.10) by serge.ecosm.com with SMTP; 10 Mar 2004 00:57:20 -0000 Message-ID: <404E67F5.8020304@ecosm.com> Date: Wed, 10 Mar 2004 00:57:00 -0000 From: Will Bryant User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) MIME-Version: 1.0 To: pthreads-win32@sources.redhat.com Subject: Re: problem using pthread_cancel and pthread_mutex_lock References: <8179ED123ECCD611A5490000F822E6EA49BEF0@mail.daronmont.com.au> In-Reply-To: <8179ED123ECCD611A5490000F822E6EA49BEF0@mail.daronmont.com.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004/txt/msg00028.txt.bz2 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... Will 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 >shutdown() >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 >shutdown >cleanly. > >Simon > >