On 4/20/13 5:03 AM, Igor Galić wrote:
----- Original Message -----
TS-1820 Cleanup the comments some, and eliminate a few unused
parameters where it was obvious
[snip]
Commit: c88d6153e0850a5c5f633ae8afd7947773b65d99
Parents: c6dd66e
[snip]
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c88d6153/iocore/cache/CacheWrite.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/CacheWrite.cc b/iocore/cache/CacheWrite.cc
index c725430..15e4183 100644
--- a/iocore/cache/CacheWrite.cc
+++ b/iocore/cache/CacheWrite.cc
@@ -831,7 +831,7 @@ agg_copy(char *p, CacheVC *vc)
// move data
if (vc->write_len) {
{
- ProxyMutex ATS_UNUSED *mutex = vc->vol->mutex;
+ ProxyMutex *mutex ATS_UNUSED = vc->vol->mutex;
ink_debug_assert(mutex->thread_holding == this_ethread());
CACHE_DEBUG_SUM_DYN_STAT(cache_write_bytes_stat,
vc->write_len);
Can someone please enlighten me as to how it makes sense that the
ProxyMutex in the CacheWrite class, that is assigned here, is not unused?
If this piece of code is not critical to warant a mutex lock, why not remove
completely?
Yes. It's because CACHE_DEBUG_SUM_DYN_STAT uses other macros, which expects
a local variable named "mutex".... It's kinda wonky, but just the way it is
:-/. So in reality, mutex *is* used, the compiler is just not smart enough
to realize it I think.
-- Leif