From dev-return-12496-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Mon Aug 02 01:12:43 2004 Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 35865 invoked from network); 2 Aug 2004 01:12:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Aug 2004 01:12:43 -0000 Received: (qmail 31544 invoked by uid 500); 2 Aug 2004 01:12:42 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 31172 invoked by uid 500); 2 Aug 2004 01:12:40 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 31145 invoked by uid 99); 2 Aug 2004 01:12:39 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Errors-To: Message-Id: <6.1.2.0.2.20040801200531.07a9aec0@pop3.rowe-clan.net> X-Sender: wrowe%rowe-clan.net@pop3.rowe-clan.net X-Mailer: QUALCOMM Windows Eudora Version 6.1.2.0 Date: Sun, 01 Aug 2004 20:07:23 -0500 To: Max Khon From: "William A. Rowe, Jr." Subject: Re: apr win32 bug [PATCH] Cc: dev@apr.apache.org In-Reply-To: <20040731215219.GB48935@samodelkin.net> References: <20040731215219.GB48935@samodelkin.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Although I agree, with your patch in spirit, if apr_thread_join is never called, your patch -can- leak handles like a sieve :( Did we ever define that apr_thread_create() must be partnered with an apr_thread_join? If not, it seems we need a clever way to mark the apr_thread_t HANDLE member as destroyed, and allow the apr_thread_join to simply return immediately. Bill At 04:52 PM 7/31/2004, Max Khon wrote: >Hi! > >apr_thread_join for win32 is implemented incorrectly: >thread handle is destroyed too early (in apr_thread_exit). >If apr_thread_exit() is called before apr_thread_join() and >new object is created (thread handle is reused) before >calling apr_thread_join(), apr_thread_join() will possibly wait >on invalid handle. > >Patch is attached. > >/fjoe