httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe Jr." <wr...@rowe-clan.net>
Subject Re: A bug, apr_os_thread_current() not equal r->connection->current_thread
Date Tue, 15 Nov 2011 20:26:03 GMT
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.

Mime
View raw message