On Tue, Mar 19, 2019 at 12:12 PM William A Rowe Jr <[email protected]>
wrote:
>
>>>
>>> The proper reset value wouldn't be NULL but INVALID_HANDLE_VALUE, which
>>> is defined like:
>>>
>>>
>>>
>>> #define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR)-1)
>>>
>>>
>>> Trying this again... we patch this;
>
> @@ -61,10 +64,11 @@
> * use a [slower] mutex object, instead.
> */
> IF_WIN_OS_IS_UNICODE {
> InitializeCriticalSection(&(*mutex)->section);
> (*mutex)->type = thread_mutex_critical_section;
> + (*mutex)->handle = INVALID_HANDLE_VALUE;
> }
> #endif
> #if APR_HAS_ANSI_FS
>
>
Michael, sorry, I'm unable to make this change at this time.
The fix we agree on is already made by ylavic in;
http://svn.apache.org/viewvc?view=revision&revision=1667900
buried in a much larger contribution to 1.7.0. If you would like to offer
it as a patch to apr/trunk (and apr/branches/1.7.x) we need to evaluate how
INVALID_HANDLE_VALUE would behave in lieu of NULL across the functions.
I'm satisfied that the new NULL behavior is preferable to leaving a closed
handle lying around for double-closure, and that the defect in your PR is
'fixed'.