Updated Branches:
  refs/heads/master f2055d129 -> fe640a253

fix another race condition in cache init.


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

Branch: refs/heads/master
Commit: fe640a253f78764fd0d89588bd8864946c817882
Parents: f2055d1
Author: weijin <[email protected]>
Authored: Mon Apr 23 10:15:01 2012 +0800
Committer: weijin <[email protected]>
Committed: Mon Apr 23 10:15:01 2012 +0800

----------------------------------------------------------------------
 CHANGES               |    2 ++
 iocore/cache/Cache.cc |    3 +--
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fe640a25/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 4fad773..839016d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 3.1.4
+  *) [TS-1214] another race condition in cache init.
+
   *) [TS-1130] Wrong CAS operation on ink_time_t on 64 bit system.
 
   *) [TS-1127] Wrong returned value of incoming port address. This

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fe640a25/iocore/cache/Cache.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index 064058a..06eff9e 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -1656,10 +1656,9 @@ build_vol_hash_table(CacheHostRecord *cp)
 
 void
 Cache::vol_initialized(bool result) {
-  ink_atomic_increment(&total_initialized_vol, 1);
   if (result)
     ink_atomic_increment(&total_good_nvol, 1);
-  if (total_nvol == total_initialized_vol)
+  if (total_nvol == ink_atomic_increment(&total_initialized_vol, 1) + 1)
     open_done();
 }
 

Reply via email to