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

masaori pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 02e0824b72 Cleanup: Remove deprecated MUTEX_TAKE_LOCK_FOR (#11095)
02e0824b72 is described below

commit 02e0824b72791dcbdfead9c516a5bccc8cef0ce1
Author: Masaori Koshiba <masa...@apache.org>
AuthorDate: Tue Feb 27 07:59:24 2024 +0900

    Cleanup: Remove deprecated MUTEX_TAKE_LOCK_FOR (#11095)
---
 include/iocore/eventsystem/Lock.h     | 6 ++----
 src/iocore/eventsystem/UnixEThread.cc | 8 +++++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/iocore/eventsystem/Lock.h 
b/include/iocore/eventsystem/Lock.h
index d0a92bff2c..30aa18c668 100644
--- a/include/iocore/eventsystem/Lock.h
+++ b/include/iocore/eventsystem/Lock.h
@@ -111,11 +111,9 @@
 #endif
 
 #ifdef DEBUG
-#define MUTEX_TAKE_LOCK(_m, _t)         Mutex_lock(MakeSourceLocation(), (char 
*)nullptr, _m, _t)
-#define MUTEX_TAKE_LOCK_FOR(_m, _t, _c) Mutex_lock(MakeSourceLocation(), 
nullptr, _m, _t)
+#define MUTEX_TAKE_LOCK(_m, _t) Mutex_lock(MakeSourceLocation(), (char 
*)nullptr, _m, _t)
 #else
-#define MUTEX_TAKE_LOCK(_m, _t)         Mutex_lock(_m, _t)
-#define MUTEX_TAKE_LOCK_FOR(_m, _t, _c) Mutex_lock(_m, _t)
+#define MUTEX_TAKE_LOCK(_m, _t) Mutex_lock(_m, _t)
 #endif // DEBUG
 
 #define MUTEX_UNTAKE_LOCK(_m, _t) Mutex_unlock(_m, _t)
diff --git a/src/iocore/eventsystem/UnixEThread.cc 
b/src/iocore/eventsystem/UnixEThread.cc
index 8b9b92ae47..1539423a95 100644
--- a/src/iocore/eventsystem/UnixEThread.cc
+++ b/src/iocore/eventsystem/UnixEThread.cc
@@ -32,6 +32,7 @@
 //
 /////////////////////////////////////////////////////////////////////
 #include "P_EventSystem.h"
+#include "iocore/eventsystem/Lock.h"
 
 #if HAVE_EVENTFD
 #include <sys/eventfd.h>
@@ -328,9 +329,10 @@ EThread::execute()
   // Do the start event first.
   // coverity[lock]
   if (start_event) {
-    MUTEX_TAKE_LOCK_FOR(start_event->mutex, this, start_event->continuation);
-    start_event->continuation->handleEvent(EVENT_IMMEDIATE, start_event);
-    MUTEX_UNTAKE_LOCK(start_event->mutex, this);
+    {
+      SCOPED_MUTEX_LOCK(lock, start_event->mutex, this);
+      start_event->continuation->handleEvent(EVENT_IMMEDIATE, start_event);
+    }
     free_event(start_event);
     start_event = nullptr;
   }

Reply via email to