diff options
author | bjh <bjh@13f79535-47bb-0310-9956-ffa450edef68> | 2001-12-30 14:30:58 +0000 |
---|---|---|
committer | bjh <bjh@13f79535-47bb-0310-9956-ffa450edef68> | 2001-12-30 14:30:58 +0000 |
commit | 5cd59bd4d5502c841ae0a0f5d520481c64d6f1bf (patch) | |
tree | b65e5bcfa752a8801687576d240a7103ab253518 /file_io/os2 | |
parent | 4f9f87c87fa9ec66b2574f14fa454099e6e0f17f (diff) | |
download | libapr-5cd59bd4d5502c841ae0a0f5d520481c64d6f1bf.tar.gz |
OS/2: switch buffered file I/O over to using apr_thread_mutex_t instead of
apr_lock_t.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62685 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/os2')
-rw-r--r-- | file_io/os2/open.c | 5 | ||||
-rw-r--r-- | file_io/os2/readwrite.c | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/file_io/os2/open.c b/file_io/os2/open.c index a80f4d56a..6664da334 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -99,8 +99,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr if (dafile->buffered) { dafile->buffer = apr_palloc(cntxt, APR_FILE_BUFSIZE); - rv = apr_lock_create(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, - APR_LOCK_DEFAULT, NULL, cntxt); + rv = apr_thread_mutex_create(&dafile->mutex, 0, cntxt); if (rv) return rv; @@ -173,7 +172,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) } if (file->buffered) - apr_lock_destroy(file->mutex); + apr_thread_mutex_destroy(file->mutex); return APR_SUCCESS; } diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index d2cea2e8f..8f521a4fe 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -77,7 +77,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size ULONG blocksize; ULONG size = *nbytes; - apr_lock_acquire(thefile->mutex); + apr_thread_mutex_lock(thefile->mutex); if (thefile->direction == 1) { apr_file_flush(thefile); @@ -111,7 +111,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } *nbytes = rc == 0 ? pos - (char *)buf : 0; - apr_lock_release(thefile->mutex); + apr_thread_mutex_unlock(thefile->mutex); if (*nbytes == 0 && rc == 0) { return APR_EOF; @@ -164,7 +164,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a int blocksize; int size = *nbytes; - apr_lock_acquire(thefile->mutex); + apr_thread_mutex_lock(thefile->mutex); if ( thefile->direction == 0 ) { // Position file pointer for writing at the offset we are logically reading from @@ -186,7 +186,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a size -= blocksize; } - apr_lock_release(thefile->mutex); + apr_thread_mutex_unlock(thefile->mutex); return APR_OS2_STATUS(rc); } else { if (thefile->flags & APR_APPEND) { |