gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 05/06: mhd_threads: added new macro MHD_join_thread_tid_


From: gnunet
Subject: [libmicrohttpd] 05/06: mhd_threads: added new macro MHD_join_thread_tid_()
Date: Mon, 11 Sep 2023 18:51:52 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 35cfb56e7d4d7a950cb8e7b68c68b9cb81064e90
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri Sep 8 12:02:17 2023 +0300

    mhd_threads: added new macro MHD_join_thread_tid_()
---
 src/microhttpd/daemon.c      | 8 ++++----
 src/microhttpd/mhd_threads.h | 3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 36c67074..23f06baa 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -3902,7 +3902,7 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon)
     MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
     if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
          (! pos->thread_joined) &&
-         (! MHD_join_thread_ (pos->tid.handle)) )
+         (! MHD_join_thread_tid_ (&pos->tid)) )
       MHD_PANIC (_ ("Failed to join a thread.\n"));
 #endif
 #ifdef UPGRADE_SUPPORT
@@ -8288,7 +8288,7 @@ close_all_connections (struct MHD_Daemon *daemon)
          * MHD_resume_connection() during finishing of "upgraded"
          * thread. */
         MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
-        if (! MHD_join_thread_ (pos->tid.handle))
+        if (! MHD_join_thread_tid_ (&pos->tid))
           MHD_PANIC (_ ("Failed to join a thread.\n"));
         pos->thread_joined = true;
         MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
@@ -8320,7 +8320,7 @@ close_all_connections (struct MHD_Daemon *daemon)
       if (! pos->thread_joined)
       {
         MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
-        if (! MHD_join_thread_ (pos->tid.handle))
+        if (! MHD_join_thread_tid_ (&pos->tid))
           MHD_PANIC (_ ("Failed to join a thread.\n"));
         MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
         pos->thread_joined = true;
@@ -8458,7 +8458,7 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
         mhd_assert (false); /* Should never happen */
       }
 
-      if (! MHD_join_thread_ (daemon->tid.handle))
+      if (! MHD_join_thread_tid_ (&daemon->tid))
       {
         MHD_PANIC (_ ("Failed to join a thread.\n"));
       }
diff --git a/src/microhttpd/mhd_threads.h b/src/microhttpd/mhd_threads.h
index 925ac95d..6e1dce32 100644
--- a/src/microhttpd/mhd_threads.h
+++ b/src/microhttpd/mhd_threads.h
@@ -155,6 +155,9 @@ typedef struct _MHD_thread_handle_ID_ MHD_thread_handle_ID_;
     (CloseHandle ( (thread)), ! 0) : 0 )
 #endif
 
+#define MHD_join_thread_tid_(thread_handle_ID_ptr) \
+  (MHD_join_thread_((thread_handle_ID_ptr)->handle))
+
 #if defined(MHD_USE_POSIX_THREADS)
 /**
  * Check whether provided thread ID matches current thread.

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]