diff options
author | stas <stas@13f79535-47bb-0310-9956-ffa450edef68> | 2004-09-24 23:18:06 +0000 |
---|---|---|
committer | stas <stas@13f79535-47bb-0310-9956-ffa450edef68> | 2004-09-24 23:18:06 +0000 |
commit | 86698c093a58eada810c10dc13f4734944aadba3 (patch) | |
tree | 6ba1646029d88356d97a5cd21f2b6236204b9ffa /file_io | |
parent | 540959182af4c86b58e88ed00624db638badd0e7 (diff) | |
download | libapr-86698c093a58eada810c10dc13f4734944aadba3.tar.gz |
fix apr_file_dup and apr_file_dup2 win32 implementations
to create a mutex
PR:
Obtained from:
Submitted by: Steve Hay <steve.hay uk.radan.com>
Reviewed by: stas
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65350 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r-- | file_io/win32/filedup.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 57c57ea02..63aa25089 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -44,6 +44,13 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, (*new_file)->buffered = FALSE; (*new_file)->ungetchar = old_file->ungetchar; +#if APR_HAS_THREADS + if (old_file->mutex) { + apr_thread_mutex_create(&((*new_file)->mutex), + APR_THREAD_MUTEX_DEFAULT, p); + } +#endif + apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), file_cleanup, apr_pool_cleanup_null); @@ -118,6 +125,13 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, new_file->buffered = FALSE; new_file->ungetchar = old_file->ungetchar; +#if APR_HAS_THREADS + if (old_file->mutex) { + apr_thread_mutex_create(&(new_file->mutex), + APR_THREAD_MUTEX_DEFAULT, p); + } +#endif + return APR_SUCCESS; #endif /* !defined(_WIN32_WCE) */ } |