Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83624 - in branches/release: boost/chrono boost/chrono/detail boost/chrono/detail/inlined/posix boost/chrono/io boost/chrono/io_v1 libs/chrono/build libs/chrono/doc libs/chrono/example libs/chrono/src libs/chrono/test libs/chrono/test/clock libs/chrono/test/duration libs/chrono/test/io libs/chrono/test/time_point libs/chrono/test/traits
From: vicente.botet_at_[hidden]
Date: 2013-03-28 19:45:28


Author: viboes
Date: 2013-03-28 19:45:26 EDT (Thu, 28 Mar 2013)
New Revision: 83624
URL: http://svn.boost.org/trac/boost/changeset/83624

Log:
Chrono: merge from trunk 1.54.
Added:
   branches/release/libs/chrono/test/another_obj.cpp
      - copied unchanged from r82801, /trunk/libs/chrono/test/another_obj.cpp
   branches/release/libs/chrono/test/one_obj.cpp
      - copied unchanged from r82801, /trunk/libs/chrono/test/one_obj.cpp
Properties modified:
   branches/release/boost/chrono/detail/ (props changed)
   branches/release/boost/chrono/io/ (props changed)
   branches/release/boost/chrono/io_v1/ (props changed)
   branches/release/libs/chrono/example/ (props changed)
   branches/release/libs/chrono/src/ (props changed)
   branches/release/libs/chrono/test/clock/ (props changed)
   branches/release/libs/chrono/test/duration/ (props changed)
   branches/release/libs/chrono/test/io/ (props changed)
   branches/release/libs/chrono/test/time_point/ (props changed)
   branches/release/libs/chrono/test/traits/ (props changed)
   branches/release/libs/chrono/test/win32_test.cpp (props changed)
Text files modified:
   branches/release/boost/chrono/config.hpp | 4 +++-
   branches/release/boost/chrono/detail/inlined/posix/thread_clock.hpp | 2 ++
   branches/release/boost/chrono/duration.hpp | 6 +++---
   branches/release/boost/chrono/io/duration_units.hpp | 11 +++++++++++
   branches/release/boost/chrono/time_point.hpp | 7 ++++---
   branches/release/libs/chrono/build/Jamfile.v2 | 3 +++
   branches/release/libs/chrono/doc/chrono.qbk | 5 +++--
   branches/release/libs/chrono/test/Jamfile.v2 | 6 +++++-
   branches/release/libs/chrono/test/io/time_point_output.cpp | 3 +--
   9 files changed, 35 insertions(+), 12 deletions(-)

Modified: branches/release/boost/chrono/config.hpp
==============================================================================
--- branches/release/boost/chrono/config.hpp (original)
+++ branches/release/boost/chrono/config.hpp 2013-03-28 19:45:26 EDT (Thu, 28 Mar 2013)
@@ -126,8 +126,10 @@
 
 #if defined( BOOST_NO_CXX11_NUMERIC_LIMITS )
 #define BOOST_CHRONO_LIB_CONSTEXPR
+#elif defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 1002
+ #define BOOST_CHRONO_LIB_CONSTEXPR
 #else
-#define BOOST_CHRONO_LIB_CONSTEXPR BOOST_CONSTEXPR
+ #define BOOST_CHRONO_LIB_CONSTEXPR BOOST_CONSTEXPR
 #endif
 
 #if defined( BOOST_NO_CXX11_NUMERIC_LIMITS )

Modified: branches/release/boost/chrono/detail/inlined/posix/thread_clock.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/posix/thread_clock.hpp (original)
+++ branches/release/boost/chrono/detail/inlined/posix/thread_clock.hpp 2013-03-28 19:45:26 EDT (Thu, 28 Mar 2013)
@@ -14,7 +14,9 @@
 #include <boost/chrono/thread_clock.hpp>
 #include <cassert>
 
+#if !defined(__VXWORKS__)
 # include <sys/times.h>
+#endif
 # include <pthread.h>
 # include <unistd.h>
 

Modified: branches/release/boost/chrono/duration.hpp
==============================================================================
--- branches/release/boost/chrono/duration.hpp (original)
+++ branches/release/boost/chrono/duration.hpp 2013-03-28 19:45:26 EDT (Thu, 28 Mar 2013)
@@ -433,10 +433,10 @@
         rep rep_;
     public:
 
- BOOST_CONSTEXPR
+ BOOST_FORCEINLINE BOOST_CONSTEXPR
         duration() : rep_(duration_values<rep>::zero()) { }
         template <class Rep2>
- BOOST_SYMBOL_VISIBLE inline BOOST_CONSTEXPR
+ BOOST_SYMBOL_VISIBLE BOOST_FORCEINLINE BOOST_CONSTEXPR
         explicit duration(const Rep2& r
         , typename boost::enable_if <
                     mpl::and_ <
@@ -461,7 +461,7 @@
 
         // conversions
         template <class Rep2, class Period2>
- BOOST_CONSTEXPR
+ BOOST_FORCEINLINE BOOST_CONSTEXPR
         duration(const duration<Rep2, Period2>& d
         , typename boost::enable_if <
                     mpl::or_ <

Modified: branches/release/boost/chrono/io/duration_units.hpp
==============================================================================
--- branches/release/boost/chrono/io/duration_units.hpp (original)
+++ branches/release/boost/chrono/io/duration_units.hpp 2013-03-28 19:45:26 EDT (Thu, 28 Mar 2013)
@@ -978,6 +978,17 @@
                 duration_units_default_holder<CharT>::initialized_ = true;
               }
           }
+ ~duration_units_default_initializer_t()
+ {
+ if (duration_units_default_holder<CharT>::initialized_)
+ {
+ delete[] duration_units_default_holder<CharT>::n_d_valid_units_;
+ duration_units_default_holder<CharT>::n_d_valid_units_ = 0;
+ delete[] duration_units_default_holder<CharT>::valid_units_;
+ duration_units_default_holder<CharT>::valid_units_ = 0;
+ duration_units_default_holder<CharT>::initialized_ = false;
+ }
+ }
       };
       namespace /**/
       {

Modified: branches/release/boost/chrono/time_point.hpp
==============================================================================
--- branches/release/boost/chrono/time_point.hpp (original)
+++ branches/release/boost/chrono/time_point.hpp 2013-03-28 19:45:26 EDT (Thu, 28 Mar 2013)
@@ -168,16 +168,17 @@
         duration d_;
 
     public:
- BOOST_CONSTEXPR
+ BOOST_FORCEINLINE BOOST_CONSTEXPR
         time_point() : d_(duration::zero())
         {}
- BOOST_CONSTEXPR explicit time_point(const duration& d)
+ BOOST_FORCEINLINE BOOST_CONSTEXPR
+ explicit time_point(const duration& d)
             : d_(d)
         {}
 
         // conversions
         template <class Duration2>
- BOOST_CONSTEXPR
+ BOOST_FORCEINLINE BOOST_CONSTEXPR
         time_point(const time_point<clock, Duration2>& t
                 , typename boost::enable_if
                 <

Modified: branches/release/libs/chrono/build/Jamfile.v2
==============================================================================
--- branches/release/libs/chrono/build/Jamfile.v2 (original)
+++ branches/release/libs/chrono/build/Jamfile.v2 2013-03-28 19:45:26 EDT (Thu, 28 Mar 2013)
@@ -37,15 +37,18 @@
         <toolset>gcc:<cxxflags>-Wextra
         <toolset>gcc:<cxxflags>-pedantic
         <toolset>gcc:<cxxflags>-Wno-long-long
+ <toolset>gcc:<cxxflags>-Wno-variadic-macros
         <toolset>darwin:<cxxflags>-Wextra
         <toolset>darwin:<cxxflags>-pedantic
         <toolset>darwin:<cxxflags>-Wno-long-long
+ <toolset>darwin:<cxxflags>-Wno-variadic-macros
         #<toolset>pathscale:<cxxflags>-Wextra
         <toolset>pathscale:<cxxflags>-Wno-long-long
         <toolset>pathscale:<cxxflags>-pedantic
         <toolset>clang:<cxxflags>-Wextra
         <toolset>clang:<cxxflags>-pedantic
         <toolset>clang:<cxxflags>-Wno-long-long
+ <toolset>clang:<cxxflags>-Wno-variadic-macros
         <toolset>gcc-mingw-4.4.0:<cxxflags>-fdiagnostics-show-option
         <toolset>gcc-mingw-4.5.0:<cxxflags>-fdiagnostics-show-option
         <toolset>gcc-mingw-4.6.0:<cxxflags>-fdiagnostics-show-option

Modified: branches/release/libs/chrono/doc/chrono.qbk
==============================================================================
--- branches/release/libs/chrono/doc/chrono.qbk (original)
+++ branches/release/libs/chrono/doc/chrono.qbk 2013-03-28 19:45:26 EDT (Thu, 28 Mar 2013)
@@ -3330,7 +3330,7 @@
 [note This means, in particular, that operations on these types will not throw exceptions.]
 
 * lvalues of the types `TC::rep`, `TC::duration`, and `TC::time_point` are swappable,
-* the function `TC::now()` does not throw exceptions, and
+* the function `TC::now()` does not throw exceptions and it is thread-safe, and
 * the type `TC::time_point::clock` meets the `TrivialClock` requirements, recursively.
 
 Models of __TrivialClock:
@@ -3350,7 +3350,8 @@
 A type `EcC` meets the `EcClock` requirements if
 
 * `TC` satisfies the `TrivialClock ` requirements, and
-* it add `now()` interfaces allowing to recover internal error codes as described in the following table.
+* it adds `now()` interfaces allowing to recover internal error codes as described in the following table.
+* the added now() function is thread-safe.
 
 In this table `C1` denotes a `EcClock` type and `ec` is an instance of a `boost::system::error_code`.
 

Modified: branches/release/libs/chrono/test/Jamfile.v2
==============================================================================
--- branches/release/libs/chrono/test/Jamfile.v2 (original)
+++ branches/release/libs/chrono/test/Jamfile.v2 2013-03-28 19:45:26 EDT (Thu, 28 Mar 2013)
@@ -28,15 +28,18 @@
         <toolset>gcc:<cxxflags>-Wextra
         <toolset>gcc:<cxxflags>-pedantic
         <toolset>gcc:<cxxflags>-Wno-long-long
+ <toolset>gcc:<cxxflags>-Wno-variadic-macros
         <toolset>darwin:<cxxflags>-Wextra
         <toolset>darwin:<cxxflags>-pedantic
         <toolset>darwin:<cxxflags>-Wno-long-long
+ <toolset>darwin:<cxxflags>-Wno-variadic-macros
         #<toolset>pathscale:<cxxflags>-Wextra
         <toolset>pathscale:<cxxflags>-Wno-long-long
         <toolset>pathscale:<cxxflags>-pedantic
         <toolset>clang:<cxxflags>-Wextra
         <toolset>clang:<cxxflags>-pedantic
         <toolset>clang:<cxxflags>-Wno-long-long
+ <toolset>clang:<cxxflags>-Wno-variadic-macros
         <toolset>gcc-mingw-4.5.0:<cxxflags>-Wno-missing-field-initializers
         <toolset>gcc-mingw-4.5.0:<cxxflags>-fdiagnostics-show-option
         <toolset>msvc:<cxxflags>/wd4127
@@ -222,7 +225,7 @@
         : $(sources[1]:B)_h ]
     ;
 }
-rule chrono-run2-mt ( sources : name )
+rule chrono-run2-mt ( sources * : name )
 {
     return
     [ run $(sources) ../build//boost_chrono
@@ -451,6 +454,7 @@
     test-suite "clock"
         :
         [ chrono-run2-mt clock/clock_pass.cpp : clock_clock_p ]
+ [ chrono-run2-mt one_obj.cpp another_obj.cpp : two_obj_p ]
         ;
 
     test-suite "io_ex"

Modified: branches/release/libs/chrono/test/io/time_point_output.cpp
==============================================================================
--- branches/release/libs/chrono/test/io/time_point_output.cpp (original)
+++ branches/release/libs/chrono/test/io/time_point_output.cpp 2013-03-28 19:45:26 EDT (Thu, 28 Mar 2013)
@@ -2,7 +2,6 @@
 // Distributed under the Boost Software License, Version 1.0.
 // See http://www.boost.org/LICENSE_1_0.txt
 
-#define BOOST_CHRONO_VERSION 2
 #include <boost/chrono/chrono_io.hpp>
 #include <sstream>
 #include <boost/detail/lightweight_test.hpp>
@@ -158,7 +157,6 @@
   test_good_symbol_system_clock("1970-01-01 00:00:00.200000 +0000", duration<boost::int_least64_t, deci> (2));
   test_good_symbol_system_clock("1970-01-01 00:00:00.066667 +0000", duration<boost::int_least64_t, ratio<1, 30> > (2));
 }
-#endif
 
 void test_gmtime(std::time_t t)
 {
@@ -174,6 +172,7 @@
     std::cout << "sec " << tm.tm_sec << std::endl;
   }
 }
+#endif
 
 int main()
 {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk