trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jplev...@apache.org
Subject svn commit: r1101332 - in /trafficserver/traffic/trunk/lib/ts: ink_queue.cc ink_queue.h ink_queue_utils.cc
Date Tue, 10 May 2011 06:31:57 GMT
Author: jplevyak
Date: Tue May 10 06:31:57 2011
New Revision: 1101332

URL: http://svn.apache.org/viewvc?rev=1101332&view=rev
Log:
Fix crash in atomics on i386.  It seems that the compiler has gotten more
aggressive and requires the volatiles to be declared volatile :)

Modified:
    trafficserver/traffic/trunk/lib/ts/ink_queue.cc
    trafficserver/traffic/trunk/lib/ts/ink_queue.h
    trafficserver/traffic/trunk/lib/ts/ink_queue_utils.cc

Modified: trafficserver/traffic/trunk/lib/ts/ink_queue.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_queue.cc?rev=1101332&r1=1101331&r2=1101332&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_queue.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_queue.cc Tue May 10 06:31:57 2011
@@ -612,7 +612,7 @@ ink_atomiclist_push(InkAtomicList * l, v
   head_p head;
   head_p item_pair;
   int result = 0;
-  void *h = NULL;
+  volatile void *h = NULL;
   ink_assert(*adr_of_next == NULL);
   do {
     INK_QUEUE_LD64(head, l->head);

Modified: trafficserver/traffic/trunk/lib/ts/ink_queue.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_queue.h?rev=1101332&r1=1101331&r2=1101332&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_queue.h (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_queue.h Tue May 10 06:31:57 2011
@@ -77,11 +77,11 @@ extern "C"
 #if (defined(__i386__) || defined(__arm__)) && (SIZEOF_VOIDP == 4)
     struct
     {
-      void *pointer;
-      int32_t version;
+      volatile void *pointer;
+      volatile int32_t version;
     } s;
 #endif
-    int64_t data;
+    volatile int64_t data;
   } head_p;
 
 /*

Modified: trafficserver/traffic/trunk/lib/ts/ink_queue_utils.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_queue_utils.cc?rev=1101332&r1=1101331&r2=1101332&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_queue_utils.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_queue_utils.cc Tue May 10 06:31:57 2011
@@ -70,8 +70,8 @@ void
 ink_queue_load_64(void *dst, void *src)
 {
 #if (defined(__i386__) || defined(__arm__)) && (SIZEOF_VOIDP == 4)
-  int32_t src_version = (*(head_p *) src).s.version;
-  void *src_pointer = (*(head_p *) src).s.pointer;
+  volatile int32_t src_version = (*(head_p *) src).s.version;
+  volatile void *src_pointer = (*(head_p *) src).s.pointer;
 
   (*(head_p *) dst).s.version = src_version;
   (*(head_p *) dst).s.pointer = src_pointer;



Mime
View raw message