From: Alex Rousskov Date: Mon, 3 Oct 2011 20:19:24 +0000 (-0600) Subject: Use atomic int for millisecond-based Balance instead of atomic int64_t. X-Git-Tag: BumpSslServerFirst.take01~123^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e9adbbd7725ef2a728f80f9910ac171422626910;p=thirdparty%2Fsquid.git Use atomic int for millisecond-based Balance instead of atomic int64_t. Atomic int64_t may cause "undefined reference to __sync_fetch_and_add_8" linking errors, due to GCC bugs. Those errors can be fixed by building with CXXFLAGS='-march=i586' but there is no reason to introduce that complexity as 2^31 milliseconds is 35791 hours which is still plenty for our purposes. --- diff --git a/src/ipc/Queue.h b/src/ipc/Queue.h index 021b87a43a..20986103d9 100644 --- a/src/ipc/Queue.h +++ b/src/ipc/Queue.h @@ -49,7 +49,8 @@ public: typedef AtomicWord Rate; ///< pop()s per second Rate rateLimit; ///< pop()s per second limit if positive - typedef AtomicWordT AtomicSignedMsec; + // we need a signed atomic type because balance may get negative + typedef AtomicWordT AtomicSignedMsec; typedef AtomicSignedMsec Balance; /// how far ahead the reader is compared to a perfect read/sec event rate Balance balance;