From f77f9a1d44c834c3ef8379daa04cbc45fd395e87 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Wed, 27 Jun 2018 15:21:19 +0000 Subject: remove the wrong proposal in STATUS and commit a fix for my crash problems. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1834513 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ---- file_io/win32/buffer.c | 12 +++++++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/STATUS b/STATUS index 037a9b2f9..ddae00c49 100644 --- a/STATUS +++ b/STATUS @@ -98,10 +98,6 @@ CURRENT VOTES: 1.5.x patch: http://people.apache.org/~jim/patches/apr-1.5-permset.patch +1: - * make sure we don't unlock mutex when we haven't locked it. - 1.6.x patch: http://people.apache.org/~jfclere/patch.180618.txt - +1 jfclere - CURRENT test/testall -v EXCEPTIONS: Please add any platform anomilies to the following exception list. diff --git a/file_io/win32/buffer.c b/file_io/win32/buffer.c index 34e4e6393..479726535 100644 --- a/file_io/win32/buffer.c +++ b/file_io/win32/buffer.c @@ -23,13 +23,17 @@ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file, { apr_status_t rv; - apr_thread_mutex_lock(file->mutex); + if (file->mutex) { + apr_thread_mutex_lock(file->mutex); + } if(file->buffered) { /* Flush the existing buffer */ rv = apr_file_flush(file); if (rv != APR_SUCCESS) { - apr_thread_mutex_unlock(file->mutex); + if (file->mutex) { + apr_thread_mutex_unlock(file->mutex); + } return rv; } } @@ -48,7 +52,9 @@ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file, file->buffered = 0; } - apr_thread_mutex_unlock(file->mutex); + if (file->mutex) { + apr_thread_mutex_unlock(file->mutex); + } return APR_SUCCESS; } -- cgit v1.2.1