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/08/22 02:55:30 UTC

[tcl-rivet] 02/03: documenting ::rivet::thread_id

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 2a0594f2fa7b516df51813d08ab585603631d8e9
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Wed Aug 7 19:46:01 2019 +0200

    documenting ::rivet::thread_id
---
 ChangeLog                    |  4 ++++
 doc/xml/commands.xml         | 21 +++++++++++++++++++++
 src/mod_rivet_ng/rivetCore.c | 18 ++++++++++++++++++
 3 files changed, 43 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 8f4a07f..1553f5a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
 2019-08-05 Massimo Manghi <mx...@apache.org>
     * doc/xml/directives.xml: Documenting SingleThreadExit directive
 
+2019-07-27 Massimo Manghi <mx...@apache.org>
+    * doc/xml/commands.xml,src/mod_rivet_ng/rivetCore.c: Add ::rivet::thread_id
+    manual page
+
 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
diff --git a/doc/xml/commands.xml b/doc/xml/commands.xml
index 24a2484..edf2f9e 100644
--- a/doc/xml/commands.xml
+++ b/doc/xml/commands.xml
@@ -1556,6 +1556,27 @@ bab</programlisting>
 			</para>
 	    </refsect1>
 	</refentry>
+	<refentry id="thread_id">
+		<refnamediv>
+			<refname>thread_id</refname>
+			<refpurpose>Returns the Tcl interpreter current thread id</refpurpose>
+		</refnamediv>
+		<refsynopsisdiv>
+			<cmdsynopsis>
+				<command>::rivet::thread_id</command>
+			</cmdsynopsis>
+		</refsynopsisdiv>
+		<refsect1>
+			<title>Description</title>
+			<para>
+				<command>::rivet::try</command> wraps the core language
+				command and simply traps exceptions that might have raised
+				by <command>::rivet::abort_page</command> and
+				<command>::rivet::exit</command> to throw them again and
+				thus causing <command>AbortScript</command> to be executed.
+			</para>
+		</refsect1>
+	</refentry>
 
 	<refentry id="try">
 		<refnamediv>
diff --git a/src/mod_rivet_ng/rivetCore.c b/src/mod_rivet_ng/rivetCore.c
index 4f36478..23eac9f 100644
--- a/src/mod_rivet_ng/rivetCore.c
+++ b/src/mod_rivet_ng/rivetCore.c
@@ -1932,7 +1932,25 @@ TCL_CMD_HEADER( Rivet_UrlScript )
  *-----------------------------------------------------------------------------
  * Rivet_GetThreadId --
  *
+ * With a threaded bridge (worker and lazy) command [pid] on Unix systems return
+ * the same process id when called from all threads running within that process.
+ * For any debugging reason this command returns a unique thread identification
+ * that can, for instance, be matched with the thread id (tid) information 
+ * in the error log file.
  *
+ * Arguments:
+ *
+ *      None
+ *
+ * Results:
+ *
+ *      Tcl object with a string representation of the thread id
+ *
+ * Side effects:
+ *
+ *      None
+ *
+ *-----------------------------------------------------------------------------
  */
 
 #define SMALL_BUFFER_SIZE 32


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