rbb 99/11/19 12:27:38
Modified: src/include ap_mpm.h
src/modules/mpm/dexter dexter.c
src/modules/mpm/mpmt_beos mpmt_beos.c
src/modules/mpm/mpmt_pthread mpmt_pthread.c
src/modules/mpm/prefork prefork.c
src/modules/mpm/spmt_os2 spmt_os2.c
Log:
Remove the ap_thread_mutex code from all MPM's. This code isn't actually
being called anywhere, and I have compiled dexter, mpmt_pthread, and
prefork without it. Away it goes.
Revision Changes Path
1.6 +1 -10 apache-2.0/src/include/ap_mpm.h
Index: ap_mpm.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/include/ap_mpm.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ap_mpm.h 1999/08/31 05:32:17 1.5
+++ ap_mpm.h 1999/11/19 20:26:59 1.6
@@ -68,9 +68,7 @@
The MPM may or may not be multithreaded. In the event that it is
multithreaded, at any instant it guarantees a 1:1 mapping of threads
- ap_process_connection invocations. The only primitives the MPM
- provides for synchronization between threads are the ap_thread_mutex
- stuff below.
+ ap_process_connection invocations.
Note: In the future it will be possible for ap_process_connection
to return to the MPM prior to finishing the entire connection; and
@@ -113,13 +111,6 @@
/* predicate indicating if a graceful stop has been requested ...
used by the connection loop */
API_EXPORT(int) ap_graceful_stop_signalled(void);
-
-/* a mutex which synchronizes threads within one process */
-typedef struct ap_thread_mutex ap_thread_mutex;
-API_EXPORT(ap_thread_mutex *) ap_thread_mutex_new(void);
-API_EXPORT(void) ap_thread_mutex_lock(ap_thread_mutex *);
-API_EXPORT(void) ap_thread_mutex_unlock(ap_thread_mutex *);
-API_EXPORT(void) ap_thread_mutex_destroy(ap_thread_mutex *);
#ifdef HAS_OTHER_CHILD
/*
1.58 +0 -33 apache-2.0/src/modules/mpm/dexter/dexter.c
Index: dexter.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/dexter.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- dexter.c 1999/11/18 23:07:49 1.57
+++ dexter.c 1999/11/19 20:27:01 1.58
@@ -1680,39 +1680,6 @@
return NULL;
}
-struct ap_thread_mutex {
- pthread_mutex_t mutex;
-};
-
-API_EXPORT(ap_thread_mutex *) ap_thread_mutex_new(void)
-{
- ap_thread_mutex *mtx;
-
- mtx = malloc(sizeof(ap_thread_mutex));
- pthread_mutex_init(&(mtx->mutex), NULL);
- return mtx;
-}
-
-API_EXPORT(void) ap_thread_mutex_lock(ap_thread_mutex *mtx)
-{
- /* Ignoring error conditions here. :( */
- pthread_mutex_lock(&(mtx->mutex));
-}
-
-API_EXPORT(void) ap_thread_mutex_unlock(ap_thread_mutex *mtx)
-{
- /* Here too. */
- pthread_mutex_unlock(&(mtx->mutex));
-}
-
-API_EXPORT(void) ap_thread_mutex_destroy(ap_thread_mutex *mtx)
-{
- /* Here too. */
- pthread_mutex_destroy(&(mtx->mutex));
- free(mtx);
-}
-
-
static const command_rec dexter_cmds[] = {
UNIX_DAEMON_COMMANDS
LISTEN_COMMANDS
1.11 +0 -33 apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c
Index: mpmt_beos.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- mpmt_beos.c 1999/11/19 18:46:12 1.10
+++ mpmt_beos.c 1999/11/19 20:27:10 1.11
@@ -1394,39 +1394,6 @@
return NULL;
}
-struct ap_thread_mutex {
- be_mutex_t mutex;
-};
-
-API_EXPORT(ap_thread_mutex *) ap_thread_mutex_new(void)
-{
- ap_thread_mutex *mtx;
-
- mtx = malloc(sizeof(ap_thread_mutex));
- be_mutex_init(&(mtx->mutex), NULL);
- return mtx;
-}
-
-API_EXPORT(void) ap_thread_mutex_lock(ap_thread_mutex *mtx)
-{
- /* Ignoring error conditions here. :( */
- be_mutex_lock(&(mtx->mutex));
-}
-
-API_EXPORT(void) ap_thread_mutex_unlock(ap_thread_mutex *mtx)
-{
- /* Here too. */
- be_mutex_unlock(&(mtx->mutex));
-}
-
-API_EXPORT(void) ap_thread_mutex_destroy(ap_thread_mutex *mtx)
-{
- /* Here too. */
- be_mutex_destroy(&(mtx->mutex));
- free(mtx);
-}
-
-
static const command_rec mpmt_beos_cmds[] = {
UNIX_DAEMON_COMMANDS
LISTEN_COMMANDS
1.48 +0 -33 apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c
Index: mpmt_pthread.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- mpmt_pthread.c 1999/11/19 18:46:46 1.47
+++ mpmt_pthread.c 1999/11/19 20:27:18 1.48
@@ -1693,39 +1693,6 @@
return NULL;
}
-struct ap_thread_mutex {
- pthread_mutex_t mutex;
-};
-
-API_EXPORT(ap_thread_mutex *) ap_thread_mutex_new(void)
-{
- ap_thread_mutex *mtx;
-
- mtx = malloc(sizeof(ap_thread_mutex));
- pthread_mutex_init(&(mtx->mutex), NULL);
- return mtx;
-}
-
-API_EXPORT(void) ap_thread_mutex_lock(ap_thread_mutex *mtx)
-{
- /* Ignoring error conditions here. :( */
- pthread_mutex_lock(&(mtx->mutex));
-}
-
-API_EXPORT(void) ap_thread_mutex_unlock(ap_thread_mutex *mtx)
-{
- /* Here too. */
- pthread_mutex_unlock(&(mtx->mutex));
-}
-
-API_EXPORT(void) ap_thread_mutex_destroy(ap_thread_mutex *mtx)
-{
- /* Here too. */
- pthread_mutex_destroy(&(mtx->mutex));
- free(mtx);
-}
-
-
static const command_rec mpmt_pthread_cmds[] = {
UNIX_DAEMON_COMMANDS
LISTEN_COMMANDS
1.54 +0 -26 apache-2.0/src/modules/mpm/prefork/prefork.c
Index: prefork.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/prefork.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- prefork.c 1999/11/19 18:46:57 1.53
+++ prefork.c 1999/11/19 20:27:26 1.54
@@ -2960,32 +2960,6 @@
return NULL;
}
-/* there are no threads in the prefork model, so the mutexes are
- nops. */
-/* TODO: make these #defines to eliminate the function call */
-
-struct ap_thread_mutex {
- int dummy;
-};
-
-API_EXPORT(ap_thread_mutex *) ap_thread_mutex_new(void)
-{
- return malloc(sizeof(ap_thread_mutex));
-}
-
-API_EXPORT(void) ap_thread_mutex_lock(ap_thread_mutex *mtx)
-{
-}
-
-API_EXPORT(void) ap_thread_mutex_unlock(ap_thread_mutex *mtx)
-{
-}
-
-API_EXPORT(void) ap_thread_mutex_destroy(ap_thread_mutex *mtx)
-{
- free(mtx);
-}
-
/* Stub functions until this MPM supports the connection status API */
API_EXPORT(void) ap_update_connection_status(long conn_id, const char *key, \
1.24 +0 -36 apache-2.0/src/modules/mpm/spmt_os2/spmt_os2.c
Index: spmt_os2.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/spmt_os2/spmt_os2.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- spmt_os2.c 1999/11/19 18:47:15 1.23
+++ spmt_os2.c 1999/11/19 20:27:32 1.24
@@ -1753,42 +1753,6 @@
return NULL;
}
-
-struct ap_thread_mutex {
- HMTX mutex_handle;
-};
-
-API_EXPORT(ap_thread_mutex *) ap_thread_mutex_new(void)
-{
- ULONG rc;
- ap_thread_mutex *mutex = malloc(sizeof(ap_thread_mutex));
-
- rc = DosCreateMutexSem(NULL, &mutex->mutex_handle, 0, 0);
- ap_assert(rc == 0);
- return mutex;
-}
-
-API_EXPORT(void) ap_thread_mutex_lock(ap_thread_mutex *mtx)
-{
- ULONG rc;
- rc = DosRequestMutexSem(mtx->mutex_handle, SEM_INDEFINITE_WAIT);
- ap_assert(rc == 0);
-}
-
-API_EXPORT(void) ap_thread_mutex_unlock(ap_thread_mutex *mtx)
-{
- ULONG rc;
- rc = DosReleaseMutexSem(mtx->mutex_handle);
- ap_assert(rc == 0 || rc == ERROR_NOT_OWNER);
-}
-
-API_EXPORT(void) ap_thread_mutex_destroy(ap_thread_mutex *mtx)
-{
- ap_thread_mutex_unlock(mtx);
- DosCloseMutexSem(mtx->mutex_handle);
- free(mtx);
-}
-
/* Stub functions until this MPM supports the connection status API */
API_EXPORT(void) ap_update_connection_status(long conn_id, const char *key, \