Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 74726 invoked from network); 30 Oct 2009 14:12:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Oct 2009 14:12:59 -0000 Received: (qmail 36894 invoked by uid 500); 30 Oct 2009 14:12:58 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 36774 invoked by uid 500); 30 Oct 2009 14:12:58 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 36766 invoked by uid 99); 30 Oct 2009 14:12:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Oct 2009 14:12:58 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [194.25.134.83] (HELO mailout07.t-online.de) (194.25.134.83) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Oct 2009 14:12:48 +0000 Received: from fwd09.aul.t-online.de by mailout07.t-online.de with smtp id 1N3sDH-0005YD-00; Fri, 30 Oct 2009 15:12:23 +0100 Received: from [192.168.0.1] (Sm1c4mZXQtiIkJsC4gP5Jm+n18r+jtxKtLjsSp13cwtZxe94W9bQSxlW-ayD8Fcjxt4jpJa92I@[87.139.49.240]) by fwd09.webpage.t-com.de with esmtp id 1N3sD9-0BkyeW0; Fri, 30 Oct 2009 15:12:15 +0100 Message-ID: <4AEAF435.1060000@ruppert-it.de> Date: Fri, 30 Oct 2009 15:12:05 +0100 From: Stefan Ruppert User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707) MIME-Version: 1.0 To: Bojan Smojver CC: APR Development List Subject: Re: apr_file_close()/apr_socket_close() References: <1256883239.2488.54.camel@shrek.rexursive.com> <4AEAB13F.3000804@ruppert-it.de> <1256896115.2488.67.camel@shrek.rexursive.com> <4AEAC79B.3010906@ruppert-it.de> <1256904174.2488.73.camel@shrek.rexursive.com> In-Reply-To: <1256904174.2488.73.camel@shrek.rexursive.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: Sm1c4mZXQtiIkJsC4gP5Jm+n18r+jtxKtLjsSp13cwtZxe94W9bQSxlW-ayD8Fcjxt4jpJa92I X-TOI-MSGID: 46f815f7-951c-429e-9907-1b9053a13cc3 X-Virus-Checked: Checked by ClamAV on apache.org Bojan Smojver wrote: > Now, the first thread, the one using APR file, in the signal handler > that interrupted it, calls apr_file_os_get() on that file. It gets back > the FD from the second thread! That is a problem that no locking of APR > file can solve. Any action on this FD will do things to the file from > the second thread, not from this one (because it's already closed). > > But, by setting file->filedes to -1 before the close(), we can at least > mitigate the consequences of such a situation. > Ok, I got your point. It is not a threading issue. Its a signal handler issue. For that purpose your proposal works just fine. Stefan