moonchen opened a new pull request, #14102:
URL: https://github.com/apache/trafficserver/pull/14102

   Gives the `ProxyMutex` lock functions and scoped lock classes a trailing 
`LockLocation` parameter that defaults to the caller's source location, so each 
has one signature in every build and the `SCOPED_MUTEX_LOCK`, `MUTEX_TRY_LOCK` 
and related macros become one-line aliases. The handler-name argument, which 
every caller passed as null, is removed, and the scoped lock constructors are 
`[[nodiscard]]`.
   
   The macros existed only to inject `__FILE__` and `__LINE__` for the lock 
diagnostics in DEBUG builds, which forced the lock API to change shape between 
DEBUG and release builds and made the classes awkward to use without a macro. A 
default argument records the same location at the call site. Outside DEBUG 
builds `LockLocation` is an empty type, so release builds carry no location at 
all. A scoped lock created as a temporary, as in `MutexLock(mutex, thread);`, 
releases the mutex at the end of that statement, and `[[nodiscard]]` turns that 
mistake into a compiler diagnostic.
   


-- 
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