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

michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git


The following commit(s) were added to refs/heads/master by this push:
     new 2d32579  Add support for FreeBSD's pthread_getthreadid_np()
2d32579 is described below

commit 2d3257974fc5eef51a0c6d5946b28e42f84bc180
Author: Michael Osipov <micha...@apache.org>
AuthorDate: Mon Mar 9 14:55:38 2020 +0100

    Add support for FreeBSD's pthread_getthreadid_np()
    
    Call directly pthread_getthreadid_np() in ssl_thread_id(void).
    
    Patch based on the FreeBSD Port of tomcat-native:
    
https://svnweb.freebsd.org/ports/head/www/tomcat-native/files/patch-src_ssl.c?revision=528004&view=o
---
 native/src/ssl.c                  | 6 ++++++
 xdocs/miscellaneous/changelog.xml | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/native/src/ssl.c b/native/src/ssl.c
index 473ca49..57fbb53 100644
--- a/native/src/ssl.c
+++ b/native/src/ssl.c
@@ -24,6 +24,10 @@
 #include <sys/syscall.h>
 #endif
 
+#ifdef __FreeBSD__
+#include <pthread_np.h>
+#endif
+
 #ifdef HAVE_OPENSSL
 #include "ssl_private.h"
 
@@ -478,6 +482,8 @@ static unsigned long ssl_thread_id(void)
     uint64_t tid;
     pthread_threadid_np(NULL, &tid);
     return (unsigned long)tid;
+#elif defined(__FreeBSD__)
+    return (unsigned long)pthread_getthreadid_np();
 #elif defined(__linux__)
     return (unsigned long)syscall(SYS_gettid);
 #else
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index f9f457a..d88bc79 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -34,6 +34,14 @@
   This is the Changelog for Tomcat Native 1.2.
   </p>
 </section>
+<section name="Changes in 1.2.24">
+  <changelog>
+    <add>
+      Add support for FreeBSD's pthread_getthreadid_np() in our
+      ssl_thread_id(void). (michaelo)
+    </add>
+  </changelog>
+</section>
 <section name="Changes in 1.2.23">
   <changelog>
     <fix>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to