From: Ryan Bloom Date: Fri, 19 Nov 1999 20:27:32 +0000 (+0000) Subject: Remove the ap_thread_mutex code from all MPM's. This code isn't actually X-Git-Tag: 1.3.10~159 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=409d49d2f24d81d295e0b5e636579429bd35d1d3;p=apache 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84138 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/ap_mpm.h b/include/ap_mpm.h index c2bfdbb49f..aedf35443a 100644 --- a/include/ap_mpm.h +++ b/include/ap_mpm.h @@ -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 @@ -114,13 +112,6 @@ API_EXPORT(int) ap_mpm_run(ap_context_t *pconf, ap_context_t *plog, server_rec * 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 /* * register an other_child -- a child which the main loop keeps track of diff --git a/server/mpm/dexter/dexter.c b/server/mpm/dexter/dexter.c index 16fc65a013..bdf1d61495 100644 --- a/server/mpm/dexter/dexter.c +++ b/server/mpm/dexter/dexter.c @@ -1680,39 +1680,6 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg) 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 diff --git a/server/mpm/mpmt_beos/mpmt_beos.c b/server/mpm/mpmt_beos/mpmt_beos.c index 4987bda7ba..662bdaa849 100644 --- a/server/mpm/mpmt_beos/mpmt_beos.c +++ b/server/mpm/mpmt_beos/mpmt_beos.c @@ -1394,39 +1394,6 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg) 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 diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c index a74750d711..26dedf1156 100644 --- a/server/mpm/mpmt_pthread/mpmt_pthread.c +++ b/server/mpm/mpmt_pthread/mpmt_pthread.c @@ -1693,39 +1693,6 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg) 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 diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index e98a6eff87..883050ee99 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -2960,32 +2960,6 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg) 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, \ diff --git a/server/mpm/spmt_os2/spmt_os2.c b/server/mpm/spmt_os2/spmt_os2.c index 75d054fc53..75de4becb6 100644 --- a/server/mpm/spmt_os2/spmt_os2.c +++ b/server/mpm/spmt_os2/spmt_os2.c @@ -1753,42 +1753,6 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg) 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, \