Updated Branches:
  refs/heads/master 11c11c8e6 -> f4acef88e

fix a wrong CAS operation of ink_time_t variables on 64 bit system.


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

Branch: refs/heads/master
Commit: f4acef88e0d1918e0b76fe83f1a1c5a62dd54974
Parents: 11c11c8
Author: weijin <[email protected]>
Authored: Sat Apr 21 21:45:43 2012 +0800
Committer: weijin <[email protected]>
Committed: Sat Apr 21 21:57:19 2012 +0800

----------------------------------------------------------------------
 CHANGES                    |    2 ++
 proxy/http/HttpTransact.cc |    8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f4acef88/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index fc5e71c..4fad773 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 3.1.4
+  *) [TS-1130] Wrong CAS operation on ink_time_t on 64 bit system.
+
   *) [TS-1127] Wrong returned value of incoming port address. This
    API is deprecated, so I also fixed the regression tests accordingly.
    Authors: Yakov Kopel and Leif.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f4acef88/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 7537206..9ea25e8 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -8298,8 +8298,12 @@ ink_cluster_time(void)
   old = global_time;
 
   while (local_time > global_time) {
-    if (ink_atomic_cas((int32_t *) & global_time, *((int32_t *) & old), 
*((int32_t *) & local_time))) {
-      break;
+    if (sizeof(ink_time_t) == 4) {
+      if (ink_atomic_cas((int32_t *) & global_time, *((int32_t *) & old), 
*((int32_t *) & local_time)))
+        break;
+    } else if (sizeof(ink_time_t) == 8) {
+      if ((ink_atomic_cas64((int64_t *) & global_time), *((int64_t *) & old), 
*((int64_t *) & local_time)))
+        break;
     }
     old = global_time;
   }

Reply via email to