Updated Branches:
  refs/heads/master 4ed023427 -> 22bd64a66

TS-1278 Clang warns: Volatile fields read but results discarded

Fix these by adding #ifdef DEBUG around. This makes it compile
with both --enable-debug and without.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/22bd64a6
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/22bd64a6
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/22bd64a6

Branch: refs/heads/master
Commit: 22bd64a667f3300d94bb147683925ed51b30e18d
Parents: 5703590
Author: Igor Galić <[email protected]>
Authored: Fri Jul 20 21:07:44 2012 -0700
Committer: Igor Galić <[email protected]>
Committed: Fri Jul 20 21:07:44 2012 -0700

----------------------------------------------------------------------
 iocore/cache/Cache.cc |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/22bd64a6/iocore/cache/Cache.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index 80f4f96..356e78c 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -260,7 +260,9 @@ CacheVC::do_io_read(Continuation *c, int64_t nbytes, 
MIOBuffer *abuf)
   vio.ndone = 0;
   vio.nbytes = nbytes;
   vio.vc_server = this;
+#ifdef DEBUG
   ink_assert(c->mutex->thread_holding);
+#endif
   if (!trigger && !recursive)
     trigger = c->mutex->thread_holding->schedule_imm_local(this);
   return &vio;
@@ -277,7 +279,9 @@ CacheVC::do_io_pread(Continuation *c, int64_t nbytes, 
MIOBuffer *abuf, int64_t o
   vio.nbytes = nbytes;
   vio.vc_server = this;
   seek_to = offset;
+#ifdef DEBUG
   ink_assert(c->mutex->thread_holding);
+#endif
   if (!trigger && !recursive)
     trigger = c->mutex->thread_holding->schedule_imm_local(this);
   return &vio;
@@ -293,7 +297,9 @@ CacheVC::do_io_write(Continuation *c, int64_t nbytes, 
IOBufferReader *abuf, bool
   vio.ndone = 0;
   vio.nbytes = nbytes;
   vio.vc_server = this;
+#ifdef DEBUG
   ink_assert(c->mutex->thread_holding);
+#endif
   if (!trigger && !recursive)
     trigger = c->mutex->thread_holding->schedule_imm_local(this);
   return &vio;
@@ -315,7 +321,9 @@ CacheVC::reenable(VIO *avio)
 {
   DDebug("cache_reenable", "reenable %p", this);
   (void) avio;
+#ifdef DEBUG
   ink_assert(avio->mutex->thread_holding);
+#endif
   if (!trigger) {
 #ifndef USELESS_REENABLES
     if (vio.op == VIO::READ) {
@@ -333,7 +341,9 @@ CacheVC::reenable_re(VIO *avio)
 {
   DDebug("cache_reenable", "reenable_re %p", this);
   (void) avio;
+#ifdef DEBUG
   ink_assert(avio->mutex->thread_holding);
+#endif
   if (!trigger) {
     if (!is_io_in_progress() && !recursive) {
       handleEvent(EVENT_NONE, (void *) 0);

Reply via email to