bneradt commented on code in PR #13188:
URL: https://github.com/apache/trafficserver/pull/13188#discussion_r3417124039


##########
include/ts/ts.h:
##########
@@ -1168,6 +1168,26 @@ TSReturnCode TSMutexLockTry(TSMutex mutexp);
 
 void TSMutexUnlock(TSMutex mutexp);
 
+/** Scoped lock guard for a @c TSMutex.
+
+    Locks @a mutexp on construction and unlocks it when the guard leaves scope.
+ */
+class TSMutexLockGuard
+{
+public:
+  [[nodiscard]] explicit TSMutexLockGuard(TSMutex mutexp) : m_mutex(mutexp) { 
TSMutexLock(m_mutex); }

Review Comment:
   Applied. [[nodiscard]] is now on the TSMutexLockGuard class declaration, so 
the public header uses the C++17-supported placement while keeping the guard 
constructor explicit.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to