You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tcl.apache.org by mx...@apache.org on 2019/06/30 15:14:32 UTC

[tcl-rivet] branch quattuor updated (b512414 -> a66f12d)

This is an automated email from the ASF dual-hosted git repository.

mxmanghi pushed a change to branch quattuor
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git.


    from b512414  new bridge function names, better server shutdown and single thread termination handling
     new 1a91ece  handling bridge shutdown
     new a66f12d  removed unneeded access to a thread private variable

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ChangeLog                           |  4 ++++
 src/mod_rivet_ng/rivet_worker_mpm.c | 13 ++++++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)


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


[tcl-rivet] 02/02: removed unneeded access to a thread private variable

Posted by mx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mxmanghi pushed a commit to branch quattuor
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git

commit a66f12d7096fb75e337c60dafc5106a042e9771a
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Sun Jun 30 17:14:19 2019 +0200

    removed unneeded access to a thread private variable
---
 ChangeLog | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index fe80fb0..1f48460 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2019-06-30 Massimo Manghi <mx...@apache.org>
+    * src/mod_rivet_ng/rivet_worker_mpm.c: Removed unnecessary access to thread private data
+    in WorkerBridge_Finalize
+
 2019-06-25 Massimo Manghi <mx...@apache.org>
     * src/mod_rivet_ng/rivet_worker_mpm.c: Better handling of exit signal, assigning tasks
     to functions in a more consistent way. Worker_Shutdown declared as 'static'


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


[tcl-rivet] 01/02: handling bridge shutdown

Posted by mx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mxmanghi pushed a commit to branch quattuor
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git

commit 1a91eced4b7a71d1c241ae8ada4a09a690b0d986
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Sun Jun 30 17:12:14 2019 +0200

    handling bridge shutdown
---
 src/mod_rivet_ng/rivet_worker_mpm.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/mod_rivet_ng/rivet_worker_mpm.c b/src/mod_rivet_ng/rivet_worker_mpm.c
index 38443a3..988d81e 100644
--- a/src/mod_rivet_ng/rivet_worker_mpm.c
+++ b/src/mod_rivet_ng/rivet_worker_mpm.c
@@ -75,6 +75,8 @@ typedef struct mpm_bridge_status {
 #ifdef RIVET_SERIALIZE_HTTP_REQUESTS
     apr_thread_mutex_t* req_mutex;
 #endif
+    int                 skip_thread_on_exit;   /* To exclusively handle the *
+                                                * WorkerBridge_Shutdown     */
 } mpm_bridge_status;
 
 
@@ -128,13 +130,14 @@ enum
  */
 
 static
-void Worker_Bridge_Shutdown (int not_to_be_waited)
+void Worker_Bridge_Shutdown (void)
 {
     int                 waits;
     void*               v;
     handler_private*    thread_obj;
     apr_status_t        rv;
     apr_uint32_t        threads_to_stop;
+    int                 not_to_be_waited = module_globals->mpm->skip_thread_on_exit;
 
     apr_thread_mutex_lock(module_globals->mpm->job_mutex);
 
@@ -600,7 +603,8 @@ void Worker_Bridge_ChildInit (apr_pool_t* pool, server_rec* server)
     module_globals->mpm->workers            = NULL;
     module_globals->mpm->server_shutdown    = 0;
     //module_globals->mpm->exit_command       = 0;
-
+    module_globals->mpm->skip_thread_on_exit = 0;
+    
     /* We keep some atomic counters that could provide basic data for a workload balancer */
 
     module_globals->mpm->threads_count = (apr_uint32_t *) apr_pcalloc(pool,sizeof(apr_uint32_t));
@@ -783,10 +787,8 @@ apr_status_t Worker_Bridge_Finalize (void* data)
     apr_status_t  rv;
     apr_status_t  thread_status;
     server_rec* s = (server_rec*) data;
-    rivet_thread_private* private;
 
-    RIVET_PRIVATE_DATA(rivet_thread_key,private)
-    Worker_Bridge_Shutdown(private->thread_exit);
+    Worker_Bridge_Shutdown();
 
     rv = apr_thread_join (&thread_status,module_globals->mpm->supervisor);
     if (rv != APR_SUCCESS)
@@ -889,6 +891,7 @@ int Worker_Bridge_ExitHandler(rivet_thread_private* private)
 
     if (!private->running_conf->single_thread_exit)
     {
+        module_globals->mpm->skip_thread_on_exit = 1;
 
         /* 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() */


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