summaryrefslogtreecommitdiff
path: root/file_io
diff options
context:
space:
mode:
authormturk <mturk@13f79535-47bb-0310-9956-ffa450edef68>2018-04-24 07:14:11 +0000
committermturk <mturk@13f79535-47bb-0310-9956-ffa450edef68>2018-04-24 07:14:11 +0000
commit2c11d40478cf330abc3a3b45658cd1dbc0fc9de0 (patch)
tree02f35918f634ce77a65f54d94ffe2d8011a4478d /file_io
parent654f9cd64f2818e98096868edc75917d9a82135f (diff)
downloadlibapr-2c11d40478cf330abc3a3b45658cd1dbc0fc9de0.tar.gz
Unlock mutex only if APR_FOPEN_XTHREAD flag is set
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1829962 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r--file_io/win32/buffer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/file_io/win32/buffer.c b/file_io/win32/buffer.c
index 1b7d857ca..7f5d9d375 100644
--- a/file_io/win32/buffer.c
+++ b/file_io/win32/buffer.c
@@ -31,7 +31,9 @@ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file,
/* Flush the existing buffer */
rv = apr_file_flush(file);
if (rv != APR_SUCCESS) {
- apr_thread_mutex_unlock(file->mutex);
+ if (file->flags & APR_FOPEN_XTHREAD) {
+ apr_thread_mutex_unlock(file->mutex);
+ }
return rv;
}
}