You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Henry Jen <he...@ztune.net> on 2006/09/07 01:21:01 UTC
Win32 apr_os_thread_get and apr_os_thread_put has mismatch type
Hi,
On Windows apr_os_threads_t is defined as HANDLE, but in
apr_os_thread_get and apr_os_thread_put implementation for Win32, it
mis-use apr_os_thread_t* as HANDLE(thd->td is a HANDLE).
Attached is a patch fix that issue, could someone please review it?
Cheers,
Henry
Re: Win32 apr_os_thread_get and apr_os_thread_put has mismatch type
Posted by Henry Jen <he...@ztune.net>.
William A. Rowe, Jr. wrote:
> Henry Jen wrote:
>> - *thethd = thd->td;
>> + *thethd = &thd->td;
>
> -1 - I don't know if you noticed but you just returned to the caller
> the address of the HANDLE in the thd object, meaning that it won't
> outlive the destruction of the thd.
>
>
Good point. What's your suggestion?
The patch is bad, but it won't change the fact this is a bug.
Unfortunately, I don't see a easy way out top off my head.
Cheers,
Henry
Re: Win32 apr_os_thread_get and apr_os_thread_put has mismatch type
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Henry Jen wrote:
> - *thethd = thd->td;
> + *thethd = &thd->td;
-1 - I don't know if you noticed but you just returned to the caller
the address of the HANDLE in the thd object, meaning that it won't
outlive the destruction of the thd.