Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: CVS

svn commit: r1374874 - /httpd/httpd/trunk/server/mpm/winnt/child.c

 

 

Apache cvs RSS feed   Index | Next | Previous | View Threaded


trawick at apache

Aug 19, 2012, 3:38 PM

Post #1 of 1 (57 views)
Permalink
svn commit: r1374874 - /httpd/httpd/trunk/server/mpm/winnt/child.c

Author: trawick
Date: Sun Aug 19 22:38:57 2012
New Revision: 1374874

URL: http://svn.apache.org/viewvc?rev=1374874&view=rev
Log:
WinNT MPM: Fix thread-safety issue in worker_main(). All
workers were allocating from pchild without holding '
child_lock. Allocate from ptrans instead.

Related to: PR 52196

The reporter suggests that the apr_thread_t for r->connection->current_thread
should have a unique pool. This revision handles that for WinNT MPM,
but not for other MPMs.

Modified:
httpd/httpd/trunk/server/mpm/winnt/child.c

Modified: httpd/httpd/trunk/server/mpm/winnt/child.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/child.c?rev=1374874&r1=1374873&r2=1374874&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/child.c (original)
+++ httpd/httpd/trunk/server/mpm/winnt/child.c Sun Aug 19 22:38:57 2012
@@ -798,7 +798,7 @@ apr_status_t winnt_insert_network_bucket
*/
static DWORD __stdcall worker_main(void *thread_num_val)
{
- apr_thread_t *thd = NULL;
+ apr_thread_t *thd;
apr_os_thread_t osthd;
static int requests_this_child = 0;
winnt_conn_ctx_t *context = NULL;
@@ -810,7 +810,6 @@ static DWORD __stdcall worker_main(void
apr_int32_t disconnected;

osthd = apr_os_thread_current();
- apr_os_thread_put(&thd, &osthd, pchild);

while (1) {

@@ -848,6 +847,8 @@ static DWORD __stdcall worker_main(void
continue;
}

+ thd = NULL;
+ apr_os_thread_put(&thd, &osthd, context->ptrans);
c->current_thread = thd;

/* follow ap_process_connection(c, context->sock) logic

Apache cvs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.