You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2001/12/30 00:16:24 UTC
cvs commit: httpd-2.0/server/mpm/worker mpm.h worker.c
trawick 01/12/29 15:16:24
Modified: include mpm_common.h
modules/aaa mod_auth_digest.c
modules/mappers mod_rewrite.c
modules/ssl ssl_engine_mutex.c
server mpm_common.c
server/mpm/beos beos.c
server/mpm/perchild perchild.c
server/mpm/prefork prefork.c
server/mpm/spmt_os2 spmt_os2.c
server/mpm/winnt mpm_winnt.c
server/mpm/worker mpm.h worker.c
Log:
handle the disappearance of apr_lock_create_np() and
apr_proc_mutex_create_np() and the new parameter to
apr_lock_create() and apr_proc_mutex_create()
Revision Changes Path
1.31 +1 -1 httpd-2.0/include/mpm_common.h
Index: mpm_common.h
===================================================================
RCS file: /home/cvs/httpd-2.0/include/mpm_common.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- mpm_common.h 17 Nov 2001 14:02:25 -0000 1.30
+++ mpm_common.h 29 Dec 2001 23:16:23 -0000 1.31
@@ -254,7 +254,7 @@
* The system mutex implementation to use for the accept mutex.
*/
#ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
-extern apr_lockmech_e_np ap_accept_lock_mech;
+extern apr_lockmech_e ap_accept_lock_mech;
const char *ap_mpm_set_accept_lock_mech(cmd_parms *cmd, void *dummy,
const char *arg);
#endif
1.56 +2 -2 httpd-2.0/modules/aaa/mod_auth_digest.c
Index: mod_auth_digest.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/aaa/mod_auth_digest.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- mod_auth_digest.c 29 Dec 2001 03:34:33 -0000 1.55
+++ mod_auth_digest.c 29 Dec 2001 23:16:23 -0000 1.56
@@ -364,7 +364,7 @@
tmpnam(client_lock_name);
sts = apr_lock_create(&client_lock, APR_READWRITE, APR_LOCKALL,
- client_lock_name, ctx);
+ APR_LOCK_DEFAULT, client_lock_name, ctx);
if (sts != APR_SUCCESS) {
log_error_and_cleanup("failed to create lock", sts, s);
return;
@@ -382,7 +382,7 @@
tmpnam(opaque_lock_name);
sts = apr_lock_create(&opaque_lock, APR_MUTEX, APR_LOCKALL,
- opaque_lock_name, ctx);
+ APR_LOCK_DEFAULT, opaque_lock_name, ctx);
if (sts != APR_SUCCESS) {
log_error_and_cleanup("failed to create lock", sts, s);
return;
1.91 +4 -3 httpd-2.0/modules/mappers/mod_rewrite.c
Index: mod_rewrite.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_rewrite.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -r1.90 -r1.91
--- mod_rewrite.c 23 Nov 2001 16:35:22 -0000 1.90
+++ mod_rewrite.c 29 Dec 2001 23:16:23 -0000 1.91
@@ -941,8 +941,8 @@
proxy_available = (ap_find_linked_module("mod_proxy.c") != NULL);
/* create the rewriting lockfiles in the parent */
- if ((rv = apr_lock_create (&rewrite_log_lock, APR_MUTEX, APR_LOCKALL,
- NULL, p)) != APR_SUCCESS) {
+ if ((rv = apr_lock_create(&rewrite_log_lock, APR_MUTEX, APR_LOCKALL,
+ APR_LOCK_DEFAULT, NULL, p)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
"mod_rewrite: could not create rewrite_log_lock");
return HTTP_INTERNAL_SERVER_ERROR;
@@ -3266,7 +3266,8 @@
lockname = ap_server_root_relative(p, lockname);
/* create the lockfile */
- rc = apr_lock_create (&rewrite_mapr_lock_acquire, APR_MUTEX, APR_LOCKALL, lockname, p);
+ rc = apr_lock_create(&rewrite_mapr_lock_acquire, APR_MUTEX, APR_LOCKALL,
+ APR_LOCK_DEFAULT, lockname, p);
if (rc != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rc, s,
"mod_rewrite: Parent could not create RewriteLock "
1.7 +1 -1 httpd-2.0/modules/ssl/ssl_engine_mutex.c
Index: ssl_engine_mutex.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_mutex.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ssl_engine_mutex.c 19 Jul 2001 16:08:01 -0000 1.6
+++ ssl_engine_mutex.c 29 Dec 2001 23:16:23 -0000 1.7
@@ -68,7 +68,7 @@
if (mc->nMutexMode == SSL_MUTEXMODE_NONE)
return TRUE;
- if (apr_lock_create(&mc->pMutex, APR_MUTEX, APR_LOCKALL,
+ if (apr_lock_create(&mc->pMutex, APR_MUTEX, APR_LOCKALL, APR_LOCK_DEFAULT,
mc->szMutexFile, p) != APR_SUCCESS)
return FALSE;
return TRUE;
1.77 +1 -1 httpd-2.0/server/mpm_common.c
Index: mpm_common.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm_common.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- mpm_common.c 18 Dec 2001 13:48:52 -0000 1.76
+++ mpm_common.c 29 Dec 2001 23:16:23 -0000 1.77
@@ -603,7 +603,7 @@
#endif
#ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
-apr_lockmech_e_np ap_accept_lock_mech = APR_LOCK_DEFAULT;
+apr_lockmech_e ap_accept_lock_mech = APR_LOCK_DEFAULT;
AP_DECLARE(const char *) ap_mpm_set_accept_lock_mech(cmd_parms *cmd,
void *dummy,
const char *arg)
1.75 +2 -2 httpd-2.0/server/mpm/beos/beos.c
Index: beos.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/beos/beos.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- beos.c 18 Dec 2001 13:48:53 -0000 1.74
+++ beos.c 29 Dec 2001 23:16:23 -0000 1.75
@@ -813,7 +813,7 @@
* in select at a time
*/
if ((rv = apr_lock_create(&accept_mutex, APR_MUTEX, APR_CROSS_PROCESS,
- NULL, pconf)) != APR_SUCCESS) {
+ APR_LOCK_DEFAULT, NULL, pconf)) != APR_SUCCESS) {
/* tsch tsch, can't have more than one thread in the accept loop
at a time so we need to fall on our sword... */
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
@@ -825,7 +825,7 @@
* locks the worker_thread_count so we have ana ccurate count...
*/
if ((rv = apr_lock_create(&worker_thread_count_mutex, APR_MUTEX, APR_CROSS_PROCESS,
- NULL, pconf)) != APR_SUCCESS) {
+ APR_LOCK_DEFAULT, NULL, pconf)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
"Couldn't create worker thread count lock");
return 1;
1.97 +8 -8 httpd-2.0/server/mpm/perchild/perchild.c
Index: perchild.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/perchild.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -r1.96 -r1.97
--- perchild.c 23 Dec 2001 14:22:36 -0000 1.96
+++ perchild.c 29 Dec 2001 23:16:23 -0000 1.97
@@ -1012,15 +1012,15 @@
}
apr_pool_create(&thread_pool_parent, pchild);
apr_lock_create(&thread_pool_parent_mutex, APR_MUTEX, APR_INTRAPROCESS,
- NULL, pchild);
+ APR_LOCK_DEFAULT, NULL, pchild);
apr_lock_create(&idle_thread_count_mutex, APR_MUTEX, APR_INTRAPROCESS,
- NULL, pchild);
+ APR_LOCK_DEFAULT, NULL, pchild);
apr_lock_create(&worker_thread_count_mutex, APR_MUTEX, APR_INTRAPROCESS,
- NULL, pchild);
+ APR_LOCK_DEFAULT, NULL, pchild);
apr_lock_create(&pipe_of_death_mutex, APR_MUTEX, APR_INTRAPROCESS,
- NULL, pchild);
+ APR_LOCK_DEFAULT, NULL, pchild);
apr_lock_create(&thread_accept_mutex, APR_MUTEX, APR_INTRAPROCESS,
- NULL, pchild);
+ APR_LOCK_DEFAULT, NULL, pchild);
apr_threadattr_create(&worker_thread_attr, pchild);
apr_threadattr_detach_set(worker_thread_attr, 1);
@@ -1295,9 +1295,9 @@
ap_lock_fname = apr_psprintf(_pconf, "%s.%u",
ap_server_root_relative(_pconf, ap_lock_fname),
my_pid);
- rv = SAFE_ACCEPT(apr_lock_create_np(&process_accept_mutex, APR_MUTEX,
- APR_CROSS_PROCESS, ap_accept_lock_mech,
- ap_lock_fname, _pconf));
+ rv = SAFE_ACCEPT(apr_lock_create(&process_accept_mutex, APR_MUTEX,
+ APR_CROSS_PROCESS, ap_accept_lock_mech,
+ ap_lock_fname, _pconf));
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
"Couldn't create cross-process lock");
1.227 +2 -2 httpd-2.0/server/mpm/prefork/prefork.c
Index: prefork.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/prefork.c,v
retrieving revision 1.226
retrieving revision 1.227
diff -u -r1.226 -r1.227
--- prefork.c 19 Dec 2001 14:49:22 -0000 1.226
+++ prefork.c 29 Dec 2001 23:16:24 -0000 1.227
@@ -265,8 +265,8 @@
apr_status_t rv;
expand_lock_fname(p);
- rv = apr_lock_create_np(&accept_lock, APR_MUTEX, APR_CROSS_PROCESS,
- ap_accept_lock_mech, ap_lock_fname, p);
+ rv = apr_lock_create(&accept_lock, APR_MUTEX, APR_CROSS_PROCESS,
+ ap_accept_lock_mech, ap_lock_fname, p);
if (rv) {
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, NULL, "couldn't create accept mutex");
exit(APEXIT_INIT);
1.113 +2 -1 httpd-2.0/server/mpm/spmt_os2/spmt_os2.c
Index: spmt_os2.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/spmt_os2/spmt_os2.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -r1.112 -r1.113
--- spmt_os2.c 18 Dec 2001 13:48:53 -0000 1.112
+++ spmt_os2.c 29 Dec 2001 23:16:24 -0000 1.113
@@ -187,7 +187,8 @@
*/
static void accept_mutex_init(apr_pool_t *p)
{
- apr_status_t rc = apr_lock_create(&accept_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, p);
+ apr_status_t rc = apr_lock_create(&accept_mutex, APR_MUTEX, APR_INTRAPROCESS,
+ APR_LOCK_DEFAULT, NULL, p);
if (rc != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_EMERG, rc, ap_server_conf,
1.203 +8 -5 httpd-2.0/server/mpm/winnt/mpm_winnt.c
Index: mpm_winnt.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm_winnt.c,v
retrieving revision 1.202
retrieving revision 1.203
diff -u -r1.202 -r1.203
--- mpm_winnt.c 18 Dec 2001 13:48:53 -0000 1.202
+++ mpm_winnt.c 29 Dec 2001 23:16:24 -0000 1.203
@@ -988,7 +988,7 @@
if (one_process) {
/* Single process mode */
apr_lock_create(&start_mutex, APR_MUTEX, APR_CROSS_PROCESS,
- signal_name_prefix, pconf);
+ APR_LOCK_DEFAULT, signal_name_prefix, pconf);
exit_event = CreateEvent(NULL, TRUE, FALSE, exit_event_name);
}
else {
@@ -1013,7 +1013,8 @@
ap_run_child_init(pchild, ap_server_conf);
allowed_globals.jobsemaphore = CreateSemaphore(NULL, 0, 1000000, NULL);
- apr_lock_create(&allowed_globals.jobmutex, APR_MUTEX, APR_INTRAPROCESS, NULL, pchild);
+ apr_lock_create(&allowed_globals.jobmutex, APR_MUTEX, APR_INTRAPROCESS,
+ APR_LOCK_DEFAULT, NULL, pchild);
/*
* Wait until we have permission to start accepting connections.
@@ -1040,7 +1041,8 @@
NULL,
0,
0); /* CONCURRENT ACTIVE THREADS */
- apr_lock_create(&qlock, APR_MUTEX, APR_INTRAPROCESS, NULL, pchild);
+ apr_lock_create(&qlock, APR_MUTEX, APR_INTRAPROCESS, APR_LOCK_DEFAULT,
+ NULL, pchild);
}
/*
@@ -1993,8 +1995,9 @@
* Ths start mutex is used during a restart to prevent more than one
* child process from entering the accept loop at once.
*/
- apr_lock_create(&start_mutex,APR_MUTEX, APR_CROSS_PROCESS, signal_name_prefix,
- ap_server_conf->process->pool);
+ apr_lock_create(&start_mutex,APR_MUTEX, APR_CROSS_PROCESS,
+ APR_LOCK_DEFAULT, signal_name_prefix,
+ ap_server_conf->process->pool);
}
}
else /* parent_pid != my_pid */
1.8 +0 -2 httpd-2.0/server/mpm/worker/mpm.h
Index: mpm.h
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/worker/mpm.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- mpm.h 25 Dec 2001 02:30:53 -0000 1.7
+++ mpm.h 29 Dec 2001 23:16:24 -0000 1.8
@@ -73,9 +73,7 @@
#define AP_MPM_WANT_SET_LOCKFILE
#define AP_MPM_WANT_SET_MAX_REQUESTS
#define AP_MPM_WANT_SET_COREDUMPDIR
-#if APR_HAS_CREATE_LOCKS_NP
#define AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
-#endif /* APR_HAS_CREATE_LOCKS_NP */
#define AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK
#define MPM_SYNC_CHILD_TABLE() (ap_sync_scoreboard_image())
1.58 +2 -9 httpd-2.0/server/mpm/worker/worker.c
Index: worker.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/worker/worker.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- worker.c 29 Dec 2001 17:36:17 -0000 1.57
+++ worker.c 29 Dec 2001 23:16:24 -0000 1.58
@@ -1399,20 +1399,14 @@
ap_server_root_relative(_pconf, ap_lock_fname),
ap_my_pid);
-#if APR_HAS_CREATE_LOCKS_NP
- rv = apr_proc_mutex_create_np(&accept_mutex, ap_lock_fname,
- ap_accept_lock_mech, _pconf);
-#else
- rv = apr_proc_mutex_create(&accept_mutex, ap_lock_fname, _pconf);
-#endif /* APR_HAS_CREATE_LOCKS_NP */
-
+ rv = apr_proc_mutex_create(&accept_mutex, ap_lock_fname,
+ ap_accept_lock_mech, _pconf);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
"Couldn't create accept lock");
return 1;
}
-#if APR_HAS_CREATE_LOCKS_NP
#if APR_USE_SYSVSEM_SERIALIZE
if (ap_accept_lock_mech == APR_LOCK_DEFAULT ||
ap_accept_lock_mech == APR_LOCK_SYSVSEM) {
@@ -1426,7 +1420,6 @@
return 1;
}
}
-#endif /* APR_HAS_CREATE_LOCKS_NP */
if (!is_graceful) {
ap_run_pre_mpm(pconf, SB_SHARED);