httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Greene" <usrgre-...@tds.net>
Subject [PATCH] Important Solaris Libthread Fix for Apache 1.3
Date Thu, 30 Nov 2000 19:42:54 GMT
This is a reposting of a fix that conforms to your posting rules.
For a description of the problem this fixes see my posting called solaris + libthread + keepalive
fix.
I relize this patch will need to be modified slightly to be more compatible with other platforms.

Is there a possibility this could make the next release?

Thanks,
Jason Greene


===================================================================
RCS file: /home/cvspublic/apache-1.3/src/main/http_main.c,v
retrieving revision 1.516
diff -u -r1.516 http_main.c
--- http_main.c 2000/11/22 02:46:27 1.516
+++ http_main.c 2000/11/30 17:32:59
@@ -1367,9 +1367,17 @@
      ap_set_callback_and_alarm(alarm_fn, 0);
     }
 }
-
+/* ap_reset_signal_mask (int signo) clears any specified process masks that may be in effect,
+ * this is thread compatible.
+ */

+void ap_reset_signal_mask(int signo)
+{
+    sigset_t signal_set;

+    sigaddset(&signal_set,signo);
+    sigprocmask(SIG_UNBLOCK,&signal_set,NULL);
+}

 void ap_keepalive_timeout(char *name, request_rec *r)
 {
@@ -3822,7 +3830,7 @@
     struct sockaddr sa_server;
     struct sockaddr sa_client;
     listen_rec *lr;
-
+
     /* All of initialization is a critical section, we don't care if we're
      * told to HUP or USR1 before we're done initializing.  For example,
      * we could be half way through child_init_modules() when a restart
@@ -3890,6 +3898,8 @@
     signal(SIGURG, timeout);
 #endif
 #endif
+    /* Clear any outstanding alarm masks to allow thread compatibility */
+    ap_reset_signal_mask(SIGALRM);
     signal(SIGALRM, alrm_handler);
 #ifdef TPF
     signal(SIGHUP, just_die);



Mime
View raw message