summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2018-09-05 16:40:12 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2018-09-05 16:40:12 +0000
commit2d2ddce092a240040ea5553daae558e9cb13df2b (patch)
tree6c732042a4c71fb196916e3ce80b2c9785910519
parente5939bcedc880042da12415a57ef3406b71e43f7 (diff)
downloadlibapr-2d2ddce092a240040ea5553daae558e9cb13df2b.tar.gz
Revert r1834513, in favor of r1840143, which consisted of...
Backport the *bugfix* part of r1808457 and further bugfix r1829962, to only manipulate the mutex when opened for XTHREAD. This follows the mutex logic obvious in file_io/win32/readwrite.c This patch ignores the optimizations introduced by r1808457. Submitted by: kotkov, mturk git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1840144 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--file_io/win32/buffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/file_io/win32/buffer.c b/file_io/win32/buffer.c
index 479726535..a32016255 100644
--- a/file_io/win32/buffer.c
+++ b/file_io/win32/buffer.c
@@ -23,7 +23,7 @@ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file,
{
apr_status_t rv;
- if (file->mutex) {
+ if (thefile->flags & APR_FOPEN_XTHREAD) {
apr_thread_mutex_lock(file->mutex);
}
@@ -31,7 +31,7 @@ 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) {
- if (file->mutex) {
+ if (thefile->flags & APR_FOPEN_XTHREAD) {
apr_thread_mutex_unlock(file->mutex);
}
return rv;
@@ -52,7 +52,7 @@ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file,
file->buffered = 0;
}
- if (file->mutex) {
+ if (thefile->flags & APR_FOPEN_XTHREAD) {
apr_thread_mutex_unlock(file->mutex);
}