]> granicus.if.org Git - apache/commitdiff
Remove the ap_thread_mutex code from all MPM's. This code isn't actually
authorRyan Bloom <rbb@apache.org>
Fri, 19 Nov 1999 20:27:32 +0000 (20:27 +0000)
committerRyan Bloom <rbb@apache.org>
Fri, 19 Nov 1999 20:27:32 +0000 (20:27 +0000)
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

include/ap_mpm.h
server/mpm/dexter/dexter.c
server/mpm/mpmt_beos/mpmt_beos.c
server/mpm/mpmt_pthread/mpmt_pthread.c
server/mpm/prefork/prefork.c
server/mpm/spmt_os2/spmt_os2.c

index c2bfdbb49f4d554308060c5d00bac878d903fbd7..aedf35443a716c6a43efc44a4a8a4c09fd48d0ba 100644 (file)
@@ -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
index 16fc65a0138568fd596a74c2de96ae53fdf2f705..bdf1d61495c7715c3ffb13b76ffc94ea08abebbf 100644 (file)
@@ -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
index 4987bda7ba5a10442996cda1d9d329c64d87f759..662bdaa8496e71668719eac54ccaace742acfe22 100644 (file)
@@ -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
index a74750d7114cc5f264fc03ec4201404e57739f38..26dedf1156db8d522eb0cbff3257170f3650ef7b 100644 (file)
@@ -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
index e98a6eff87b0c99267f6dd9bf6a4caccf737ae10..883050ee9937002b75bbb486810b3cbe3bc83011 100644 (file)
@@ -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, \
index 75d054fc5361a6fd9963349a393ea7bb798f1e6b..75de4becb6cb29f7ab624c322e3e821d184f7f8e 100644 (file)
@@ -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, \