You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by mx...@apache.org on 2016/01/06 00:53:31 UTC

svn commit: r1723200 [2/2] - in /tcl/rivet/trunk: ./ doc/xml/ src/ src/mod_rivet/

Modified: tcl/rivet/trunk/src/mod_rivet/rivet_lazy_mpm.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/rivet_lazy_mpm.c?rev=1723200&r1=1723199&r2=1723200&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/rivet_lazy_mpm.c (original)
+++ tcl/rivet/trunk/src/mod_rivet/rivet_lazy_mpm.c Tue Jan  5 23:53:31 2016
@@ -32,6 +32,7 @@
 
 #include "mod_rivet.h"
 #include "mod_rivet_common.h"
+#include "mod_rivet_generator.h"
 #include "rivetChannel.h"
 #include "apache_config.h"
 
@@ -50,11 +51,11 @@ enum
     done
 };
 
+/* lazy bridge Tcl thread status and communication variables */
+
 typedef struct lazy_tcl_worker {
-    apr_thread_mutex_t* mutex1;
-    apr_thread_mutex_t* mutex2;
-    apr_thread_cond_t*  condition1;
-    apr_thread_cond_t*  condition2;
+    apr_thread_mutex_t* mutex;
+    apr_thread_cond_t*  condition;
     int                 status;
     apr_thread_t*       thread_id;
     server_rec*         server;
@@ -64,24 +65,26 @@ typedef struct lazy_tcl_worker {
     int                 nreqs;
 } lazy_tcl_worker;
 
+/* virtual host descriptor */
+
 typedef struct vhost_iface {
-    apr_uint32_t*       idle_threads_cnt;       /* */
-    //apr_uint32_t*       threads_count;          /* */
+    int                 idle_threads_cnt;   /* */
     int                 threads_count;
-    apr_thread_mutex_t* mutex;
-    apr_array_header_t* array;                  /* available threads  */
+    apr_thread_mutex_t* mutex;              /* mutex protecting 'array' */
+    apr_array_header_t* array;              /* LIFO array of lazy_tcl_worker pointers */
     int                 server_shutdown;
 } vhost;
 
 typedef struct mpm_bridge_status {
     apr_thread_mutex_t* mutex;
-    apr_thread_cond_t*  condition;
-    void**              workers;                /* thread pool ids          */
+    //apr_thread_cond_t*   condition;
     int                 exit_command;
     int                 exit_command_status;
-    vhost*              vhosts;
+    vhost*              vhosts;             /* array of vhost descriptors */
 } mpm_bridge_status;
 
+/* lazy bridge thread private data extension */
+
 typedef struct mpm_bridge_specific {
     rivet_thread_interp*  interp;           /* thread Tcl interpreter object        */
     rivet_server_conf*    conf;             /* rivet_server_conf* record            */
@@ -91,9 +94,6 @@ typedef struct mpm_bridge_specific {
                                              * channel                              */
 } mpm_bridge_specific;
 
-#define DEFAULT_HEADER_TYPE "text/html"
-#define BASIC_PAGE          "<b>Lazy Bridge</b>"
-
 #define MOD_RIVET_QUEUE_SIZE 100
 
 static void* APR_THREAD_FUNC request_processor (apr_thread_t *thd, void *data)
@@ -120,7 +120,8 @@ static void* APR_THREAD_FUNC request_pro
     w->nreqs = 0;
     Tcl_RegisterChannel(private->ext->interp->interp,*private->channel);
 
-    private->ext->interp->scripts = Rivet_RunningScripts (private->pool,private->ext->interp->scripts,private->ext->conf );
+    private->ext->interp->scripts = 
+            Rivet_RunningScripts (private->pool,private->ext->interp->scripts,private->ext->conf );
 
     Rivet_PerInterpInit(private->ext->interp,private,module_globals->server,private->pool);
     
@@ -141,11 +142,11 @@ static void* APR_THREAD_FUNC request_pro
                          "errorCode: %s", Tcl_GetVar(interp, "errorCode", 0));
             ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, w->server, 
                          "errorInfo: %s", Tcl_GetVar(interp, "errorInfo", 0));
-            apr_thread_mutex_lock(w->mutex2);
+            apr_thread_mutex_lock(w->mutex);
             w->status = done;
             w->ap_sts = HTTP_INTERNAL_SERVER_ERROR;
-            apr_thread_cond_signal(w->condition2);
-            apr_thread_mutex_unlock(w->mutex2);
+            apr_thread_cond_signal(w->condition);
+            apr_thread_mutex_unlock(w->mutex);
 
             /* This is broken: there must be a way to tell the array of 
              * available threads this thread is about to exit, otherwise
@@ -160,15 +161,14 @@ static void* APR_THREAD_FUNC request_pro
     }
 
     idx = private->ext->conf->idx;
+    apr_thread_mutex_lock(w->mutex);
     do 
     {
-        //char* page;
         int   http_code;
 
-        apr_thread_mutex_lock(w->mutex1);
-        apr_atomic_inc32(module_globals->mpm->vhosts[idx].idle_threads_cnt);
+        module_globals->mpm->vhosts[idx].idle_threads_cnt++;
         while ((w->status != init) && (w->status != thread_exit)) {
-            apr_thread_cond_wait(w->condition1,w->mutex1);
+            apr_thread_cond_wait(w->condition,w->mutex);
         } 
         if (w->status == thread_exit) {
             private->ext->keep_going = 0;
@@ -177,8 +177,7 @@ static void* APR_THREAD_FUNC request_pro
 
         w->status = processing;
         w->nreqs++;
-        apr_thread_mutex_unlock(w->mutex1);
-        apr_atomic_dec32(module_globals->mpm->vhosts[idx].idle_threads_cnt);
+        module_globals->mpm->vhosts[idx].idle_threads_cnt--;
 
         /* Content generation */
 
@@ -186,26 +185,12 @@ static void* APR_THREAD_FUNC request_pro
 
         if (module_globals->mpm->vhosts[idx].server_shutdown) continue;
 
-        /*
-        ap_set_content_type(w->r,apr_pstrdup(w->r->pool,DEFAULT_HEADER_TYPE));
-        ap_send_http_header(w->r);
-        page = apr_psprintf(w->r->pool,"%s: vh %d, idle threads: %d, nreqs: %d",BASIC_PAGE,idx,
-                            (int) apr_atomic_read32(module_globals->mpm->vhosts[idx].idle_threads_cnt),w->nreqs);
-        ap_rwrite(page,strlen(page),w->r);
-        ap_rflush(w->r);
-        */
-
-        apr_thread_mutex_lock(w->mutex2);
         w->status = done;
         w->ap_sts = http_code;
-        apr_thread_cond_signal(w->condition2);
-        apr_thread_mutex_unlock(w->mutex2);
-
-        apr_thread_mutex_lock(w->mutex1);
+        apr_thread_cond_signal(w->condition);
         while (w->status == done) {
-            apr_thread_cond_wait(w->condition1,w->mutex1);
+            apr_thread_cond_wait(w->condition,w->mutex);
         } 
-        apr_thread_mutex_unlock(w->mutex1);
  
         // rescheduling itself in the array of idle threads
        
@@ -214,12 +199,13 @@ static void* APR_THREAD_FUNC request_pro
         apr_thread_mutex_unlock(module_globals->mpm->vhosts[idx].mutex);
 
     } while (private->ext->keep_going);
+    apr_thread_mutex_unlock(w->mutex);
 
     apr_thread_mutex_lock(module_globals->mpm->vhosts[idx].mutex);
     (module_globals->mpm->vhosts[idx].threads_count)--;
     apr_thread_mutex_unlock(module_globals->mpm->vhosts[idx].mutex);
 
-    ap_log_error(APLOG_MARK,APLOG_DEBUG,APR_SUCCESS,module_globals->server, "processor thread orderly exit");
+    ap_log_error(APLOG_MARK,APLOG_DEBUG,APR_SUCCESS,module_globals->server,"processor thread orderly exit");
     apr_thread_exit(thd,APR_SUCCESS);
     return NULL;
 }
@@ -232,10 +218,8 @@ static lazy_tcl_worker* create_worker (a
 
     w->status = idle;
     w->server = server;
-    ap_assert(apr_thread_mutex_create(&w->mutex1,APR_THREAD_MUTEX_UNNESTED,pool) == APR_SUCCESS);
-    ap_assert(apr_thread_cond_create(&w->condition1, pool) == APR_SUCCESS); 
-    ap_assert(apr_thread_mutex_create(&w->mutex2,APR_THREAD_MUTEX_UNNESTED,pool) == APR_SUCCESS);
-    ap_assert(apr_thread_cond_create(&w->condition2, pool) == APR_SUCCESS); 
+    ap_assert(apr_thread_mutex_create(&w->mutex,APR_THREAD_MUTEX_UNNESTED,pool) == APR_SUCCESS);
+    ap_assert(apr_thread_cond_create(&w->condition, pool) == APR_SUCCESS); 
     apr_thread_create(&w->thread_id, NULL, request_processor, w, module_globals->pool);
 
     return w;
@@ -249,17 +233,15 @@ void Lazy_MPM_ChildInit (apr_pool_t* poo
 
     module_globals->mpm = apr_pcalloc(pool,sizeof(mpm_bridge_status));
 
-    //module_globals->mpm->vhosts = (vhost *) apr_pcalloc(pool,sizeof(vhost) * module_globals->vhosts_count);
-
     rv = apr_thread_mutex_create(&module_globals->mpm->mutex,APR_THREAD_MUTEX_UNNESTED,pool);
     ap_assert(rv == APR_SUCCESS);
-    rv = apr_thread_cond_create(&module_globals->mpm->condition, pool); 
-    ap_assert(rv == APR_SUCCESS);
+
+    // rv = apr_thread_cond_create(&module_globals->mpm->condition, pool); 
+    // ap_assert(rv == APR_SUCCESS);
 
     module_globals->mpm->vhosts = (vhost *) apr_pcalloc(pool,module_globals->vhosts_count * sizeof(vhost));
     ap_assert(module_globals->mpm->vhosts != NULL);
 
-    //for (vh = 0; vh < module_globals->vhosts_count; vh++)
     for (s = root_server; s != NULL; s = s->next)
     {
         int                 vh;
@@ -267,13 +249,13 @@ void Lazy_MPM_ChildInit (apr_pool_t* poo
         rivet_server_conf*  rsc = RIVET_SERVER_CONF(s->module_config);
 
         vh = rsc->idx;
-        ap_assert(apr_thread_mutex_create(&module_globals->mpm->vhosts[vh].mutex,APR_THREAD_MUTEX_UNNESTED,pool) == APR_SUCCESS);
+        rv = apr_thread_mutex_create(&module_globals->mpm->vhosts[vh].mutex,APR_THREAD_MUTEX_UNNESTED,pool);
+        ap_assert(rv == APR_SUCCESS);
         array = apr_array_make(pool,0,sizeof(void*));
         ap_assert(array != NULL);
         module_globals->mpm->vhosts[vh].array = array;
 
-        module_globals->mpm->vhosts[vh].idle_threads_cnt = (apr_uint32_t *) apr_pcalloc(pool,sizeof(apr_uint32_t));
-        apr_atomic_set32(module_globals->mpm->vhosts[vh].idle_threads_cnt,0);
+        module_globals->mpm->vhosts[vh].idle_threads_cnt = 0;
         module_globals->mpm->vhosts[vh].threads_count = 0;
         module_globals->mpm->vhosts[vh].server_shutdown = 0;
     }
@@ -287,8 +269,6 @@ int Lazy_MPM_Request (request_rec* r,riv
     apr_array_header_t* array;
     apr_thread_mutex_t* mutex;
 
-    /* If the array is empty we create a new worker thread */
-
     mutex = module_globals->mpm->vhosts[conf->idx].mutex;
     array = module_globals->mpm->vhosts[conf->idx].array;
     apr_thread_mutex_lock(mutex);
@@ -300,6 +280,8 @@ int Lazy_MPM_Request (request_rec* r,riv
         return HTTP_INTERNAL_SERVER_ERROR;
     }
 
+    /* If the array is empty we create a new worker thread */
+
     if (apr_is_empty_array(array))
     {
         w = create_worker(module_globals->pool,r->server);
@@ -312,25 +294,25 @@ int Lazy_MPM_Request (request_rec* r,riv
 
     apr_thread_mutex_unlock(mutex);
     
-    apr_thread_mutex_lock(w->mutex1);
+    apr_thread_mutex_lock(w->mutex);
     w->r        = r;
     w->ctype    = ctype;
     w->status   = init;
-    apr_thread_cond_signal(w->condition1);
-    apr_thread_mutex_unlock(w->mutex1);
+    apr_thread_cond_signal(w->condition);
+    //apr_thread_mutex_unlock(w->mutex);
 
-    apr_thread_mutex_lock(w->mutex2);
+    //apr_thread_mutex_lock(w->mutex);
     while (w->status != done) {
-        apr_thread_cond_wait(w->condition2,w->mutex2);
+        apr_thread_cond_wait(w->condition,w->mutex);
     } 
     ap_sts = w->ap_sts;
-    apr_thread_mutex_unlock(w->mutex2);
+    //apr_thread_mutex_unlock(w->mutex);
 
-    apr_thread_mutex_lock(w->mutex1);
+    //apr_thread_mutex_lock(w->mutex);
     w->status = idle;
     w->r      = NULL;
-    apr_thread_cond_signal(w->condition1);
-    apr_thread_mutex_unlock(w->mutex1);
+    apr_thread_cond_signal(w->condition);
+    apr_thread_mutex_unlock(w->mutex);
 
     return ap_sts;
 }
@@ -368,11 +350,11 @@ apr_status_t Lazy_MPM_Finalize (void* da
                 lazy_tcl_worker*    w;
 
                 w = *(lazy_tcl_worker**) apr_array_pop(array); 
-                apr_thread_mutex_lock(w->mutex1);
+                apr_thread_mutex_lock(w->mutex);
                 w->r        = NULL;
                 w->status   = thread_exit;
-                apr_thread_cond_signal(w->condition1);
-                apr_thread_mutex_unlock(w->mutex1);
+                apr_thread_cond_signal(w->condition);
+                apr_thread_mutex_unlock(w->mutex);
             }
             apr_sleep(10000);
 
@@ -396,8 +378,13 @@ int Lazy_MPM_ExitHandler(int code)
 
     private->ext->keep_going = 0;
 
-    module_globals->mpm->exit_command = 1;
-    module_globals->mpm->exit_command_status = code;
+    apr_thread_mutex_lock(module_globals->mpm->mutex);
+    if (module_globals->mpm->exit_command == 0)
+    {
+        module_globals->mpm->exit_command = 1;
+        module_globals->mpm->exit_command_status = code;
+    }
+    apr_thread_mutex_unlock(module_globals->mpm->mutex);
 
     /* We now tell the supervisor to terminate the Tcl worker thread pool to exit
      * and is sequence the whole process to shutdown by calling exit() */
@@ -411,7 +398,6 @@ RIVET_MPM_BRIDGE {
     Lazy_MPM_ChildInit,
     Lazy_MPM_Request,
     Lazy_MPM_Finalize,
-    NULL,
     Lazy_MPM_ExitHandler,
     Lazy_MPM_Interp
 };

Modified: tcl/rivet/trunk/src/mod_rivet/rivet_prefork_mpm.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/rivet_prefork_mpm.c?rev=1723200&r1=1723199&r2=1723200&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/rivet_prefork_mpm.c (original)
+++ tcl/rivet/trunk/src/mod_rivet/rivet_prefork_mpm.c Tue Jan  5 23:53:31 2016
@@ -25,11 +25,13 @@
 
 #include "mod_rivet.h"
 #include "mod_rivet_common.h"
+#include "mod_rivet_generator.h"
 #include "httpd.h"
 #include "rivetChannel.h"
 #include "apache_config.h"
 #include "rivet.h"
 #include "rivetCore.h"
+#include "worker_prefork_common.h"
 
 extern mod_rivet_globals* module_globals;
 extern apr_threadkey_t*   rivet_thread_key;
@@ -37,10 +39,6 @@ extern apr_threadkey_t*   rivet_thread_k
 rivet_thread_private*   Rivet_VirtualHostsInterps (rivet_thread_private* private);
 rivet_thread_interp*    Rivet_NewVHostInterp(apr_pool_t* pool);
 
-/* typedef struct mpm_bridge_specific {
-    rivet_thread_interp** interps;          
-} mpm_bridge_specific; */
-
 /* -- Prefork_MPM_Finalize */
 
 apr_status_t Prefork_MPM_Finalize (void* data)
@@ -72,8 +70,9 @@ void Prefork_MPM_ChildInit (apr_pool_t*
      */
 
     private = Rivet_CreatePrivateData();
-    //private->ext = apr_pcalloc(private->pool,sizeof(mpm_bridge_specific));
-    private->interps = apr_pcalloc(private->pool,module_globals->vhosts_count*sizeof(rivet_thread_interp));
+    private->ext = apr_pcalloc(private->pool,sizeof(mpm_bridge_specific));
+    private->ext->interps = 
+        apr_pcalloc(private->pool,module_globals->vhosts_count*sizeof(rivet_thread_interp));
    
     Rivet_SetupTclPanicProc ();
     ap_assert(private != NULL);
@@ -135,7 +134,7 @@ int Prefork_MPM_Request (request_rec* r,
     return Rivet_SendContent(private,r);
 }
 
-rivet_thread_interp* Prefork_MPM_MasterInterp(void)
+rivet_thread_interp* MPM_MasterInterp(void)
 {
     rivet_thread_private*   private;
 
@@ -168,7 +167,7 @@ int Prefork_MPM_ExitHandler(int code)
 
 rivet_thread_interp* Prefork_MPM_Interp(rivet_thread_private *private,rivet_server_conf* conf)
 {
-    return private->interps[conf->idx];   
+    return private->ext->interps[conf->idx];   
 }
 
 RIVET_MPM_BRIDGE {
@@ -176,7 +175,6 @@ RIVET_MPM_BRIDGE {
     Prefork_MPM_ChildInit,
     Prefork_MPM_Request,
     Prefork_MPM_Finalize,
-    Prefork_MPM_MasterInterp,
     Prefork_MPM_ExitHandler,
     Prefork_MPM_Interp
 };

Modified: tcl/rivet/trunk/src/mod_rivet/rivet_worker_mpm.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/rivet_worker_mpm.c?rev=1723200&r1=1723199&r2=1723200&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/rivet_worker_mpm.c (original)
+++ tcl/rivet/trunk/src/mod_rivet/rivet_worker_mpm.c Tue Jan  5 23:53:31 2016
@@ -31,10 +31,11 @@
 #include "rivet.h"
 #include "mod_rivet.h"
 #include "mod_rivet_common.h"
-#include "httpd.h"
+#include "mod_rivet_generator.h"
 #include "rivetChannel.h"
 #include "apache_config.h"
 #include "rivet_config.h"
+#include "worker_prefork_common.h"
 
 #define BRIDGE_SUPERVISOR_WAIT  1000000
 #define MOD_RIVET_QUEUE_SIZE        100
@@ -76,17 +77,11 @@ typedef struct mpm_bridge_status {
 #endif
 } mpm_bridge_status;
 
-/* This object is thread specific */
-
-typedef struct mpm_bridge_specific {
-    int                   keep_going;       /* thread loop controlling variable     */
-} mpm_bridge_specific;
-
-
 /* data private to the Apache callback handling the request */
 
 typedef struct _handler_private 
 {
+    rivet_thread_interp**   interps;        /* database of virtual host interps     */
     rivet_job_t             job_type;
     apr_thread_cond_t*      cond;
     apr_thread_mutex_t*     mutex;
@@ -184,9 +179,10 @@ static void* APR_THREAD_FUNC request_pro
     apr_thread_mutex_lock(module_globals->mpm->job_mutex);
 
     private = Rivet_CreatePrivateData();
-    private->interps = apr_pcalloc(private->pool,module_globals->vhosts_count*sizeof(rivet_thread_interp));
     private->ext = apr_pcalloc(private->pool,sizeof(mpm_bridge_specific));
     private->ext->keep_going = 1;
+    private->ext->interps = 
+        apr_pcalloc(private->pool,module_globals->vhosts_count*sizeof(rivet_thread_interp));
 
     if (private == NULL) 
     {
@@ -724,7 +720,7 @@ apr_status_t Worker_MPM_Finalize (void*
 }
 
 /*
- * -- Worker_MPM_MasterInterp
+ * -- MPM_MasterInterp
  *
  *  Arguments:
  *
@@ -734,7 +730,8 @@ apr_status_t Worker_MPM_Finalize (void*
  *
  */
 
-rivet_thread_interp* Worker_MPM_MasterInterp(void)
+
+rivet_thread_interp* MPM_MasterInterp(void)
 {
     rivet_thread_private*   private;
     rivet_thread_interp*    interp_obj; 
@@ -788,7 +785,7 @@ int Worker_MPM_ExitHandler(int code)
 rivet_thread_interp* Worker_MPM_Interp(rivet_thread_private *private,
                                        rivet_server_conf *conf)
 {
-    return private->interps[conf->idx];   
+    return private->ext->interps[conf->idx];   
 }
 
 RIVET_MPM_BRIDGE {
@@ -796,7 +793,6 @@ RIVET_MPM_BRIDGE {
     Worker_MPM_ChildInit,
     Worker_MPM_Request,
     Worker_MPM_Finalize,
-    Worker_MPM_MasterInterp,
     Worker_MPM_ExitHandler,
     Worker_MPM_Interp
 };

Modified: tcl/rivet/trunk/src/mod_rivet/worker_prefork_common.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/worker_prefork_common.c?rev=1723200&r1=1723199&r2=1723200&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/worker_prefork_common.c (original)
+++ tcl/rivet/trunk/src/mod_rivet/worker_prefork_common.c Tue Jan  5 23:53:31 2016
@@ -25,10 +25,13 @@
 #include <apr_strings.h>
 #include "mod_rivet.h"
 #include "mod_rivet_common.h"
+#include "worker_prefork_common.h"
 
 extern mod_rivet_globals* module_globals;
 extern apr_threadkey_t*   rivet_thread_key;
 
+extern rivet_thread_interp* MPM_MasterInterp(void);
+
 /*
  * Rivet_DuplicateVhostInterp
  *
@@ -89,8 +92,10 @@ rivet_thread_private* Rivet_VirtualHosts
 
     root_server_conf = RIVET_SERVER_CONF (root_server->module_config);
     
-    ap_assert(RIVET_MPM_BRIDGE_FUNCTION(mpm_master_interp) != NULL);
-    root_interp = (*RIVET_MPM_BRIDGE_FUNCTION(mpm_master_interp))();
+    //ap_assert(RIVET_MPM_BRIDGE_FUNCTION(mpm_master_interp) != NULL);
+    //root_interp = (*RIVET_MPM_BRIDGE_FUNCTION(mpm_master_interp))();
+
+    root_interp = MPM_MasterInterp();
 
     /* we must assume the module was able to create the root interprter otherwise
      * it's just a null module. I try to have also this case to develop experimental
@@ -172,7 +177,7 @@ rivet_thread_private* Rivet_VirtualHosts
 
         rivet_interp->scripts = Rivet_RunningScripts (private->pool,rivet_interp->scripts,myrsc);
 
-        private->interps[myrsc->idx] = rivet_interp;
+        private->ext->interps[myrsc->idx] = rivet_interp;
 
         /* Basic Rivet packages and libraries are loaded here */
 
@@ -286,7 +291,7 @@ void Rivet_ProcessorCleanup (void *data)
         /* cleaning the cache contents and deleting it */
 
         searchCtx = apr_pcalloc(private->pool,sizeof(Tcl_HashSearch));
-        entry = Tcl_FirstHashEntry(private->interps[i]->objCache,searchCtx);    
+        entry = Tcl_FirstHashEntry(private->ext->interps[i]->objCache,searchCtx);    
         while (entry)
         {
             Tcl_DecrRefCount(Tcl_GetHashValue(entry)); /* Let Tcl clear the mem allocated */
@@ -296,9 +301,9 @@ void Rivet_ProcessorCleanup (void *data)
         }
  
         if ((i > 0) && rsc->separate_channels) 
-            Rivet_ReleaseRivetChannel(private->interps[i]->interp,private->channel);
+            Rivet_ReleaseRivetChannel(private->ext->interps[i]->interp,private->channel);
 
-        Tcl_DeleteInterp(private->interps[i]->interp);
+        Tcl_DeleteInterp(private->ext->interps[i]->interp);
 
         /* if separate_virtual_interps == 0 we are running the same interpreter
          * instance for each vhost, thus we can jump out of this loop after 

Added: tcl/rivet/trunk/src/mod_rivet/worker_prefork_common.h
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/worker_prefork_common.h?rev=1723200&view=auto
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/worker_prefork_common.h (added)
+++ tcl/rivet/trunk/src/mod_rivet/worker_prefork_common.h Tue Jan  5 23:53:31 2016
@@ -0,0 +1,35 @@
+/* -- worker_prefork_common.h */
+
+/*
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+ */
+
+#ifndef __worker_prefork_common_h__
+#define __worker_prefork_common_h__
+
+/* Thread specific data common to the worker and prefork bridges 
+ * Actually the prefork bridge won't use the keep_going flag, but
+ * they share the same interpreters array
+ */
+
+typedef struct mpm_bridge_specific {
+    int                   keep_going;       /* thread loop controlling variable     */
+    rivet_thread_interp** interps;          
+} mpm_bridge_specific;
+
+#endif /* */



---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org