You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Pier Fumagalli <pi...@betaversion.org> on 2002/04/03 14:31:25 UTC
[PATCH] Worker compilation failure under Darwin...
Darwin (OS/X) doesn't define pthread_kill :( This is a brutal hack, and I
don't like it, but it works...
Pier
Index: server/mpm/worker//worker.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/worker/worker.c,v
retrieving revision 1.109
diff -U3 -r1.109 worker.c
--- server/mpm/worker//worker.c 29 Mar 2002 14:33:50 -0000 1.109
+++ server/mpm/worker//worker.c 3 Apr 2002 12:29:56 -0000
@@ -259,7 +259,11 @@
* up the listener thread since it is the only thread with SIGHUP
* unblocked, but that doesn't work on Linux
*/
+#ifdef DARWIN
+ kill(ap_my_pid, LISTENER_SIGNAL);
+#else
pthread_kill(*listener_os_thread, LISTENER_SIGNAL);
+#endif
}
#define ST_INIT 0
@@ -1043,7 +1047,11 @@
*/
iter = 0;
+#ifdef DARWIN
+ while (iter < 10 && kill(ap_my_pid, 0) == 0) {
+#else
while (iter < 10 && pthread_kill(*listener_os_thread, 0) == 0) {
+#endif
/* listener not dead yet */
apr_sleep(APR_USEC_PER_SEC / 2);
wakeup_listener();
Re: [PATCH] Worker compilation failure under Darwin...
Posted by Jeff Trawick <tr...@attglobal.net>.
Pier Fumagalli <pi...@betaversion.org> writes:
> Darwin (OS/X) doesn't define pthread_kill :( This is a brutal hack, and I
> don't like it, but it works...
I don't think it is a brutal hack in concept; the kill() code should
work on *&^%$ Linux but for some arrogance in certain circles. Let
me try to add an autoconf check for pthread_kill() and then we can do
"#ifdef HAVE_PTHREAD_KILL" instead of "#ifdef DARWIN."
(I'm trying hard to talk the wife into letting me buy an iMac. I
don't know what her problem is (other than me).)
--
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...