]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Change TPF's mutex mechanism. Add additional info to TPF diagnostic msg.
authorDavid McCreedy <mccreedy@apache.org>
Tue, 10 Sep 2002 22:51:15 +0000 (22:51 +0000)
committerDavid McCreedy <mccreedy@apache.org>
Tue, 10 Sep 2002 22:51:15 +0000 (22:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@96755 13f79535-47bb-0310-9956-ffa450edef68

src/main/http_main.c
src/os/tpf/os.c
src/os/tpf/os.h

index c14faece679354dd557b4f4403759d723c93269f..db3e04b898db4fc7cdfab5a69b9dd5065c62829b 100644 (file)
@@ -384,6 +384,7 @@ static int my_child_num;
 #ifdef TPF
 int tpf_child = 0;
 char tpf_server_name[INETD_SERVNAME_LENGTH+1];
+char tpf_mutex_key[TPF_MUTEX_KEY_SIZE];
 #endif /* TPF */
 
 scoreboard *ap_scoreboard_image = NULL;
@@ -1080,7 +1081,7 @@ static int tpf_core_held;
 static void accept_mutex_cleanup_tpfcore(void *foo)
 {
     if(tpf_core_held)
-        coruc(RESOURCE_KEY);
+        deqc(tpf_mutex_key, QUAL_S);
 }
 
 #define accept_mutex_init_tpfcore(x)
@@ -1093,14 +1094,14 @@ static void accept_mutex_child_init_tpfcore(pool *p)
 
 static void accept_mutex_on_tpfcore(void)
 {
-    corhc(RESOURCE_KEY);
+    enqc(tpf_mutex_key, ENQ_WAIT, 0, QUAL_S);
     tpf_core_held = 1;
     ap_check_signals();
 }
 
 static void accept_mutex_off_tpfcore(void)
 {
-    coruc(RESOURCE_KEY);
+    deqc(tpf_mutex_key, QUAL_S);
     tpf_core_held = 0;
     ap_check_signals();
 }
@@ -5456,6 +5457,7 @@ int REALMAIN(int argc, char *argv[])
         memcpy(tpf_server_name, input_parms.parent.servname,
                INETD_SERVNAME_LENGTH);
         tpf_server_name[INETD_SERVNAME_LENGTH + 1] = '\0';
+        sprintf(tpf_mutex_key, "%.*x", TPF_MUTEX_KEY_SIZE - 1, getpid());
         ap_open_logs(server_conf, plog);
         ap_tpf_zinet_checks(ap_standalone, tpf_server_name, server_conf);
         ap_tpf_save_argv(argc, argv);    /* save argv parms for children */
index b7aefc19e1aaeb0aa7899e0b525959e4f79822bb..fb65ae89ca47dbd957bcd9b1c2e65711b978081d 100644 (file)
@@ -423,7 +423,7 @@ void ap_tpf_zinet_checks(int standalone,
         free(idct);
     } else {
         ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, s,
-                     TPF_UNABLE_TO_DETERMINE_ZINET_MODEL);
+                     TPF_UNABLE_TO_DETERMINE_ZINET_MODEL, servername);
         exit(1); /* abort start-up of server */
     }
 
@@ -498,11 +498,14 @@ void ap_tpf_save_argv(int argc, char **argv) {
 }
 
 void os_tpf_child(APACHE_TPF_INPUT *input_parms) {
+    extern char tpf_mutex_key[TPF_MUTEX_KEY_SIZE];
+
     tpf_child = 1;
     ap_my_generation = input_parms->generation;
     ap_restart_time = input_parms->restart_time;
     tpf_fds = input_parms->tpf_fds;
     tpf_shm_static_ptr = input_parms->shm_static_ptr;
+    sprintf(tpf_mutex_key, "%.*x", TPF_MUTEX_KEY_SIZE - 1, getppid());
 }
 
 #ifndef __PIPE_
index 37f42d40a0dcb95c9f1f4fc1e2092d037a0e102f..32f7c7f495a991467725b9ba1fc7dd2cbadd91cb 100644 (file)
@@ -125,7 +125,7 @@ typedef struct fd_set {
 #define FD_SET(n, p) (0)
 #endif
 
-#define  RESOURCE_KEY ((void*) 0xC1C2C1C3)
+#define TPF_MUTEX_KEY_SIZE (sizeof(pid_t)*2+1)
 
 /* TPF doesn't have, or need, tzset (it is used in mod_expires.c) */
 #define tzset()
@@ -219,7 +219,7 @@ void ap_tpf_save_argv(int argc, char **argv);
 #endif
 
 #define TPF_UNABLE_TO_DETERMINE_ZINET_MODEL \
-        "Unable to determine ZINET model: inetd_getServer call failed" \
-        " -- Apache startup aborted"
+        "Unable to determine ZINET model: inetd_getServer(\"%s\") " \
+        "call failed -- Apache startup aborted"
 
 #endif /*! APACHE_OS_H*/