You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2004/07/31 22:47:49 UTC
cvs commit: httpd-2.0/server/mpm/experimental/perchild perchild.c
trawick 2004/07/31 13:47:49
Modified: . CHANGES
server/mpm/experimental/perchild perchild.c
Log:
perchild MPM: Fix thread safety problem in the use of longjmp().
Submitted by: Tsuyoshi SASAMOTO <nazonazo super.win.ne.jp>
Reviewed by: Jeff Trawick
Revision Changes Path
1.1542 +3 -0 httpd-2.0/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-2.0/CHANGES,v
retrieving revision 1.1541
retrieving revision 1.1542
diff -u -r1.1541 -r1.1542
--- CHANGES 30 Jul 2004 16:27:23 -0000 1.1541
+++ CHANGES 31 Jul 2004 20:47:48 -0000 1.1542
@@ -2,6 +2,9 @@
[Remove entries to the current 2.0 section below, when backported]
+ *) perchild MPM: Fix thread safety problem in the use of longjmp().
+ [Tsuyoshi SASAMOTO <nazonazo super.win.ne.jp>]
+
*) Add load balancer support to the scoreboard in preparation for
load balancing support in mod_proxy. [Mladen Turk]
1.148 +5 -3 httpd-2.0/server/mpm/experimental/perchild/perchild.c
Index: perchild.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/experimental/perchild/perchild.c,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -r1.147 -r1.148
--- perchild.c 15 Mar 2004 23:08:41 -0000 1.147
+++ perchild.c 31 Jul 2004 20:47:49 -0000 1.148
@@ -137,7 +137,7 @@
static int requests_this_child;
static int num_listensocks = 0;
static ap_pod_t *pod;
-static jmp_buf jmpbuffer;
+static jmp_buf *jmpbuffers;
struct child_info_t {
uid_t uid;
@@ -758,7 +758,7 @@
}
}
apr_thread_mutex_unlock(idle_thread_count_mutex);
- if (setjmp(jmpbuffer) != 1) {
+ if (setjmp(jmpbuffers[thread_num]) != 1) {
process_socket(ptrans, csd, conn_id, bucket_alloc);
}
else {
@@ -1668,6 +1668,8 @@
}
ap_child_table = (ap_ctable *)apr_pcalloc(p, server_limit * sizeof(ap_ctable));
+ jmpbuffers = (jmp_buf *)apr_palloc(p, thread_limit * sizeof(jmp_buf));
+
return OK;
}
@@ -1704,7 +1706,7 @@
ap_server_conf, "Could not pass request to proper "
"child, request will not be honored.");
}
- longjmp(jmpbuffer, 1);
+ longjmp(jmpbuffers[thread_num], 1);
}
return OK;
}