Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DA80D7ED9 for ; Tue, 15 Nov 2011 20:26:35 +0000 (UTC) Received: (qmail 20216 invoked by uid 500); 15 Nov 2011 20:26:35 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 20130 invoked by uid 500); 15 Nov 2011 20:26:35 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 20122 invoked by uid 99); 15 Nov 2011 20:26:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Nov 2011 20:26:34 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.202.165.36] (HELO smtpauth20.prod.mesa1.secureserver.net) (64.202.165.36) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 15 Nov 2011 20:26:27 +0000 Received: (qmail 2126 invoked from network); 15 Nov 2011 20:26:04 -0000 Received: from unknown (76.252.112.72) by smtpauth20.prod.mesa1.secureserver.net (64.202.165.36) with ESMTP; 15 Nov 2011 20:26:04 -0000 Message-ID: <4EC2CADB.7040405@rowe-clan.net> Date: Tue, 15 Nov 2011 14:26:03 -0600 From: "William A. Rowe Jr." User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: A bug, apr_os_thread_current() not equal r->connection->current_thread References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/15/2011 7:43 AM, zhiguo zhao wrote: > Hi, > I failed with this on windows with branch 2.4.x, in a handle hook, > > apr_os_thread_t t = apr_os_thread_current(); > apr_os_thread_t *t1; > apr_os_thread_get(&t1, r->connection->current_thread); > printf("EQUALS %d\n",apr_os_thread_equal(t,t1)); > > I think t and t1 must be equal, But it Not. > > I think this is a bug, Is this? No, it's not. /** * Compare two thread id's * @param tid1 1st Thread ID to compare * @param tid2 2nd Thread ID to compare * @return non-zero if the two threads are equal, zero otherwise */ APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2); This behavior is by design, use the designated comparator.