diff options
Diffstat (limited to 'file_io/win32/buffer.c')
-rw-r--r-- | file_io/win32/buffer.c | 12 |
1 files changed, 9 insertions, 3 deletions
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; } |