About half the startup time for the httpd is spent
locking and unlocking the mutex that protects the
apr_file_t's internal buffer--even though only one
thread is using the file. This patch skips the
locking unless the APR_XTHREAD flag has been set
for the file.
--Brian
Index: srclib/apr/file_io/unix/readwrite.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/unix/readwrite.c,v
retrieving revision 1.74
diff -r1.74 readwrite.c
121c121,123
< apr_thread_mutex_lock(thefile->thlock);
---
> if (thefile->flags & APR_XTHREAD) {
> apr_thread_mutex_lock(thefile->thlock);
> }
167c169,171
< apr_thread_mutex_unlock(thefile->thlock);
---
> if (thefile->flags & APR_XTHREAD) {
> apr_thread_mutex_unlock(thefile->thlock);
> }
226c230,232
< apr_thread_mutex_lock(thefile->thlock);
---
> if (thefile->flags & APR_XTHREAD) {
> apr_thread_mutex_lock(thefile->thlock);
> }
254c260,262
< apr_thread_mutex_unlock(thefile->thlock);
---
> if (thefile->flags & APR_XTHREAD) {
> apr_thread_mutex_unlock(thefile->thlock);
> }