Changeset 78802


Ignore:
Timestamp:
Jun 3, 2012, 6:11:52 PM (7 years ago)
Author:
viboes
Message:

Thread: fix TIME_UTC, WINVER, constexpr for tags, and don't use local files

Location:
trunk
Files:
32 edited

Legend:

Unmodified
Added
Removed
  • trunk/boost/thread/detail/config.hpp

    r78226 r78802  
    132132#endif
    133133
    134 #include "platform.hpp"
     134#include <boost/thread/detail/platform.hpp>
    135135
    136136// provided for backwards compatibility, since this
  • trunk/boost/thread/detail/delete.hpp

    r78139 r78802  
    99#include <boost/config.hpp>
    1010
     11/**
     12 * BOOST_THREAD_DELETE_COPY_CTOR deletes the copy constructor when the compiler supports it or
     13 * makes it private.
     14 *
     15 * BOOST_THREAD_DELETE_COPY_ASSIGN deletes the copy assignment when the compiler supports it or
     16 * makes it private.
     17 */
    1118#ifndef BOOST_NO_DELETED_FUNCTIONS
    1219#define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
     
    2835#endif // BOOST_NO_DELETED_FUNCTIONS
    2936
     37/**
     38 * BOOST_THREAD_NO_COPYABLE deletes the copy constructor and assignment when the compiler supports it or
     39 * makes them private.
     40 */
    3041#define BOOST_THREAD_NO_COPYABLE(CLASS) \
    3142    BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
  • trunk/boost/thread/future.hpp

    r78407 r78802  
    4444#endif
    4545
     46#include <boost/utility/result_of.hpp>
     47//#include <boost/thread.hpp>
     48
    4649#if defined BOOST_THREAD_PROVIDES_FUTURE
    4750#define BOOST_THREAD_FUTURE future
     
    16561659    BOOST_THREAD_DCL_MOVABLE_BEG(T) packaged_task<T> BOOST_THREAD_DCL_MOVABLE_END
    16571660
     1661//    template <class F>
     1662//    BOOST_THREAD_FUTURE<typename boost::result_of<F()>::type>
     1663//    async(launch policy, F f)
     1664//    {
     1665//        typedef typename boost::result_of<F()>::type R;
     1666//        typedef BOOST_THREAD_FUTURE<R> future;
     1667//        if (int(policy) & int(launch::async))
     1668//        {
     1669//          packaged_task<R> pt( f );
     1670//
     1671//          BOOST_THREAD_FUTURE ret = pt.get_future();
     1672//          boost::thread( boost::move(pt) ).detach();
     1673//          return ::boost::move(ret);
     1674//        }
     1675//        else if (int(policy) & int(launch::deferred))
     1676//        {
     1677//          packaged_task<R> pt( f );
     1678//
     1679//          BOOST_THREAD_FUTURE ret = pt.get_future();
     1680//          return ::boost::move(ret);
     1681//        }
     1682//    }
     1683//
     1684//    template <class F>
     1685//    BOOST_THREAD_FUTURE<typename boost::result_of<F()>::type>
     1686//    async(F f)
     1687//    {
     1688//        return async(launch::any, f);
     1689//    }
     1690
     1691
    16581692
    16591693}
  • trunk/boost/thread/locks.hpp

    r78139 r78802  
    171171    {};
    172172
    173     const defer_lock_t defer_lock={};
    174     const try_to_lock_t try_to_lock={};
    175     const adopt_lock_t adopt_lock={};
     173    BOOST_CONSTEXPR_OR_CONST defer_lock_t defer_lock={};
     174    BOOST_CONSTEXPR_OR_CONST try_to_lock_t try_to_lock={};
     175    BOOST_CONSTEXPR_OR_CONST adopt_lock_t adopt_lock={};
    176176
    177177    template<typename Mutex>
  • trunk/boost/thread/xtime.hpp

    r46124 r78802  
    33// Copyright (C) 2007-8 Anthony Williams
    44//
    5 //  Distributed under the Boost Software License, Version 1.0. (See accompanying 
     5//  Distributed under the Boost Software License, Version 1.0. (See accompanying
    66//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    77
     
    2121enum xtime_clock_types
    2222{
    23     TIME_UTC=1
     23    TIME_UTC_=1
    2424//    TIME_TAI,
    2525//    TIME_MONOTONIC,
     
    5454#endif
    5555    }
    56    
     56
    5757};
    5858
     
    6161    xtime res;
    6262    boost::posix_time::time_duration const time_since_epoch=abs_time-boost::posix_time::from_time_t(0);
    63            
     63
    6464    res.sec=static_cast<xtime::xtime_sec_t>(time_since_epoch.total_seconds());
    6565    res.nsec=static_cast<xtime::xtime_nsec_t>(time_since_epoch.fractional_seconds()*(1000000000/time_since_epoch.ticks_per_second()));
     
    6969inline int xtime_get(struct xtime* xtp, int clock_type)
    7070{
    71     if (clock_type == TIME_UTC)
     71    if (clock_type == TIME_UTC_)
    7272    {
    7373        *xtp=get_xtime(get_system_time());
     
    8282    if (xt1.sec == xt2.sec)
    8383        return (int)(xt1.nsec - xt2.nsec);
    84     else 
     84    else
    8585        return (xt1.sec > xt2.sec) ? 1 : -1;
    8686}
  • trunk/libs/thread/build/Jamfile.v2

    r78451 r78802  
    4141    : source-location ../src
    4242    : requirements <threading>multi
    43       <link>static:<define>BOOST_THREAD_BUILD_LIB=1
    44       <link>shared:<define>BOOST_THREAD_BUILD_DLL=1
     43      <link>static:<define>BOOST_THREAD_STATIC_LINK=1
     44      <link>shared:<define>BOOST_THREAD_DYN_LINK=1
    4545      -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
    4646      <tag>@$(__name__).tag
     
    9393    # : default-build <threading>multi
    9494    : usage-requirements  # pass these requirement to dependents (i.e. users)
    95       <link>static:<define>BOOST_THREAD_BUILD_LIB=1
    96       <link>shared:<define>BOOST_THREAD_BUILD_DLL=1
     95      <link>static:<define>BOOST_THREAD_STATIC_LINK=1
     96      <link>shared:<define>BOOST_THREAD_DYN_LINK=1
    9797      <define>BOOST_SYSTEM_NO_DEPRECATED
    9898      <library>/boost/system//boost_system
     
    264264    : <conditional>@requirements
    265265    :
    266     : <link>shared:<define>BOOST_THREAD_USE_DLL=1
    267       <link>static:<define>BOOST_THREAD_USE_LIB=1
     266    : #<link>shared:<define>BOOST_THREAD_USE_DLL=1
     267      #<link>static:<define>BOOST_THREAD_USE_LIB=1
    268268      <conditional>@usage-requirements
    269269    ;
  • trunk/libs/thread/doc/changes.qbk

    r78029 r78802  
    2121* [@http://svn.boost.org/trac/boost/ticket/6217 #6217] Enhance Boost.Thread shared mutex interface following Howard Hinnant proposal.
    2222* [@http://svn.boost.org/trac/boost/ticket/6224 #6224] c++11 compliance: Add the use of standard noexcept on compilers supporting them.
     23* [@http://svn.boost.org/trac/boost/ticket/6225 #6225] Add the use of standard =delete defaulted operations on compilers supporting them.
    2324* [@http://svn.boost.org/trac/boost/ticket/6226 #6226] c++11 compliance: Add explicit bool conversion from locks.
    2425* [@http://svn.boost.org/trac/boost/ticket/6228 #6228] Add promise constructor with allocator following the standard c++11.
     26* [@http://svn.boost.org/trac/boost/ticket/6229 #6229] Rename the unique_future to future following the c++11.
    2527* [@http://svn.boost.org/trac/boost/ticket/6230 #6230] c++11 compliance: Follows the exception reporting mechanism as defined in the c++11.
     28* [@http://svn.boost.org/trac/boost/ticket/6231 #6231] Add BasicLockable requirements in the documentation to follow c++11.
    2629* [@http://svn.boost.org/trac/boost/ticket/6266 #6266] Breaking change: thread destructor should call terminate if joinable.
    2730* [@http://svn.boost.org/trac/boost/ticket/6269 #6269] Breaking change: thread move assignment should call terminate if joinable.
    2831* [@http://svn.boost.org/trac/boost/ticket/6272 #6272] c++11 compliance: Add thread::id hash specialization.
    2932* [@http://svn.boost.org/trac/boost/ticket/6273 #6273] c++11 compliance: Add cv_status enum class and use it on the conditions wait functions.
    30 * [@http://svn.boost.org/trac/boost/ticket/6231 #6231] Add BasicLockable requirements in the documentation to follow c++11.
    3133* [@http://svn.boost.org/trac/boost/ticket/6342 #6342] c++11 compliance: Adapt the one_flag to the c++11 interface.
    3234* [@http://svn.boost.org/trac/boost/ticket/6671 #6671] upgrade_lock: missing mutex and release functions.
    3335* [@http://svn.boost.org/trac/boost/ticket/6672 #6672] upgrade_lock:: missing constructors from time related types.
    3436* [@http://svn.boost.org/trac/boost/ticket/6675 #6675] upgrade_lock:: missing non-member swap.
     37* [@http://svn.boost.org/trac/boost/ticket/6676 #6676] lock conversion should be explicit.
    3538* Added missing packaged_task::result_type and packaged_task:: constructor with allocator.
    3639* Added packaged_task::reset()
    3740
     41
    3842Fixed Bugs:
    3943
     44* [@http://svn.boost.org/trac/boost/ticket/2380 #2380] boost::move from lvalue does not work with gcc.
     45* [@http://svn.boost.org/trac/boost/ticket/2430 #2430] shared_mutex for win32 doesn't have timed_lock_upgrade.
    4046* [@http://svn.boost.org/trac/boost/ticket/2575 #2575] Bug- Boost 1.36.0 on Itanium platform.
     47* [@http://svn.boost.org/trac/boost/ticket/3160 #3160] Duplicate tutorial code in boost::thread.
    4148* [@http://svn.boost.org/trac/boost/ticket/4345 #4345] thread::id and joining problem with cascade of threads.
     49* [@http://svn.boost.org/trac/boost/ticket/4521 #4521] Error using boost::move on packaged_task (MSVC 10).
     50* [@http://svn.boost.org/trac/boost/ticket/4711 #4711] Must use implementation details to return move-only types.
    4251* [@http://svn.boost.org/trac/boost/ticket/4921 #4921] BOOST_THREAD_USE_DLL and BOOST_THREAD_USE_LIB are crucial and need to be documented.
    4352* [@http://svn.boost.org/trac/boost/ticket/5013 #5013] documentation: boost::thread: pthreas_exit causes terminate().
     
    4857* [@http://svn.boost.org/trac/boost/ticket/6174 #6174] packaged_task doesn't correctly handle moving results.
    4958* [@http://svn.boost.org/trac/boost/ticket/6222 #6222] Compile error with SunStudio: unique_future move.
     59* [@http://svn.boost.org/trac/boost/ticket/6354 #6354] PGI: Compiler threading support is not turned on.
    5060* [@http://svn.boost.org/trac/boost/ticket/6673 #6673] shared_lock: move assign doesn't works with c++11.
    5161* [@http://svn.boost.org/trac/boost/ticket/6674 #6674] shared_mutex: try_lock_upgrade_until doesn't works.
  • trunk/libs/thread/doc/emulations.qbk

    r78123 r78802  
    341341use
    342342
    343         switch (BOOST_SCOPED_ENUM_NATIVE(future_errc)(ev))
     343        switch (boost::native_value(ev))
    344344        {
    345345        case future_errc::broken_promise:
  • trunk/libs/thread/doc/mutex_concepts.qbk

    r78029 r78802  
    796796    struct try_to_lock_t {};
    797797    struct adopt_lock_t {};
    798     const defer_lock_t defer_lock;
    799     const try_to_lock_t try_to_lock;
    800     const adopt_lock_t adopt_lock;
     798    constexpr defer_lock_t defer_lock;
     799    constexpr try_to_lock_t try_to_lock;
     800    constexpr adopt_lock_t adopt_lock;
    801801 
    802802    template<typename Lockable>
  • trunk/libs/thread/example/starvephil.cpp

    r77918 r78802  
    5151        }
    5252        boost::xtime xt;
    53         boost::xtime_get(&xt, boost::TIME_UTC);
     53        boost::xtime_get(&xt, boost::TIME_UTC_);
    5454        xt.sec += 3;
    5555        boost::thread::sleep(xt);
     
    8686        }
    8787        boost::xtime xt;
    88         boost::xtime_get(&xt, boost::TIME_UTC);
     88        boost::xtime_get(&xt, boost::TIME_UTC_);
    8989        xt.sec += 2;
    9090        boost::thread::sleep(xt);
     
    112112            {
    113113                boost::xtime xt;
    114                 boost::xtime_get(&xt, boost::TIME_UTC);
     114                boost::xtime_get(&xt, boost::TIME_UTC_);
    115115                xt.sec += 3;
    116116                boost::thread::sleep(xt);
  • trunk/libs/thread/example/tennis.cpp

    r49978 r78802  
    22// William E. Kempf
    33//
    4 //  Distributed under the Boost Software License, Version 1.0. (See accompanying 
     4//  Distributed under the Boost Software License, Version 1.0. (See accompanying
    55//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    66
     
    105105
    106106    boost::xtime xt;
    107     boost::xtime_get(&xt, boost::TIME_UTC);
     107    boost::xtime_get(&xt, boost::TIME_UTC_);
    108108    xt.sec += 1;
    109109    boost::thread::sleep(xt);
  • trunk/libs/thread/example/thread.cpp

    r77918 r78802  
    1515    {
    1616        boost::xtime xt;
    17         boost::xtime_get(&xt, boost::TIME_UTC);
     17        boost::xtime_get(&xt, boost::TIME_UTC_);
    1818        xt.sec += m_secs;
    1919
  • trunk/libs/thread/example/xtime.cpp

    r77918 r78802  
    1111{
    1212    boost::xtime xt;
    13     boost::xtime_get(&xt, boost::TIME_UTC);
     13    boost::xtime_get(&xt, boost::TIME_UTC_);
    1414    xt.sec += 1;
    1515    boost::thread::sleep(xt); // Sleep for 1 second
  • trunk/libs/thread/src/pthread/thread.cpp

    r77849 r78802  
    2525#endif
    2626
    27 #include "timeconv.inl"
     27#include <libs/thread/src/pthread/timeconv.inl>
    2828
    2929namespace boost
     
    417417#   endif
    418418                    xtime cur;
    419                     xtime_get(&cur, TIME_UTC);
     419                    xtime_get(&cur, TIME_UTC_);
    420420                    if (xtime_cmp(xt, cur) <= 0)
    421421                        return;
     
    459459#   else
    460460            xtime xt;
    461             xtime_get(&xt, TIME_UTC);
     461            xtime_get(&xt, TIME_UTC_);
    462462            sleep(xt);
    463463#   endif
  • trunk/libs/thread/src/pthread/timeconv.inl

    r75785 r78802  
    2121{
    2222    int res = 0;
    23     res = boost::xtime_get(&xt, boost::TIME_UTC);
    24     BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
     23    res = boost::xtime_get(&xt, boost::TIME_UTC_);
     24    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
    2525
    2626    xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
     
    5757    boost::xtime cur;
    5858    int res = 0;
    59     res = boost::xtime_get(&cur, boost::TIME_UTC);
    60     BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
     59    res = boost::xtime_get(&cur, boost::TIME_UTC_);
     60    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
    6161
    6262    if (boost::xtime_cmp(xt, cur) <= 0)
     
    8888    boost::xtime cur;
    8989    int res = 0;
    90     res = boost::xtime_get(&cur, boost::TIME_UTC);
    91     BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
     90    res = boost::xtime_get(&cur, boost::TIME_UTC_);
     91    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
    9292
    9393    if (boost::xtime_cmp(xt, cur) <= 0)
     
    110110    boost::xtime cur;
    111111    int res = 0;
    112     res = boost::xtime_get(&cur, boost::TIME_UTC);
    113     BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
     112    res = boost::xtime_get(&cur, boost::TIME_UTC_);
     113    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
    114114
    115115    if (boost::xtime_cmp(xt, cur) <= 0)
  • trunk/libs/thread/src/win32/thread.cpp

    r78275 r78802  
    55// (C) Copyright 2007 David Deakins
    66
     7#ifndef _WIN32_WINNT
    78#define _WIN32_WINNT 0x400
     9#endif
     10
     11#ifndef WINVER
    812#define WINVER 0x400
     13#endif
    914
    1015#include <boost/thread/thread.hpp>
  • trunk/libs/thread/src/win32/timeconv.inl

    r40348 r78802  
    1818{
    1919    int res = 0;
    20     res = boost::xtime_get(&xt, boost::TIME_UTC);
    21     assert(res == boost::TIME_UTC);
     20    res = boost::xtime_get(&xt, boost::TIME_UTC_);
     21    assert(res == boost::TIME_UTC_);
    2222
    2323    xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
     
    5555    boost::xtime cur;
    5656    int res = 0;
    57     res = boost::xtime_get(&cur, boost::TIME_UTC);
    58     assert(res == boost::TIME_UTC);
     57    res = boost::xtime_get(&cur, boost::TIME_UTC_);
     58    assert(res == boost::TIME_UTC_);
    5959
    6060    if (boost::xtime_cmp(xt, cur) <= 0)
     
    8686    boost::xtime cur;
    8787    int res = 0;
    88     res = boost::xtime_get(&cur, boost::TIME_UTC);
    89     assert(res == boost::TIME_UTC);
     88    res = boost::xtime_get(&cur, boost::TIME_UTC_);
     89    assert(res == boost::TIME_UTC_);
    9090
    9191    if (boost::xtime_cmp(xt, cur) <= 0)
     
    108108    boost::xtime cur;
    109109    int res = 0;
    110     res = boost::xtime_get(&cur, boost::TIME_UTC);
    111     assert(res == boost::TIME_UTC);
     110    res = boost::xtime_get(&cur, boost::TIME_UTC_);
     111    assert(res == boost::TIME_UTC_);
    112112
    113113    if (boost::xtime_cmp(xt, cur) <= 0)
  • trunk/libs/thread/test/sync/futures/async/async_pass.cpp

    r76295 r78802  
    2525
    2626#include <boost/thread/future.hpp>
     27#include <boost/thread/thread.hpp>
     28#include <boost/interprocess/smart_ptr/unique_ptr.hpp>
    2729#include <memory>
    2830#include <boost/detail/lightweight_test.hpp>
     
    5052}
    5153
    52 boost::unique_ptr<int> f3(int i)
     54boost::interprocess::unique_ptr<int> f3(int i)
    5355{
    5456  boost::this_thread::sleep_for(ms(200));
    55   return boost::unique_ptr<int>(new int(i));
     57  return boost::interprocess::unique_ptr<int>(new int(i));
    5658}
    5759
    58 boost::unique_ptr<int> f4(boost::unique_ptr<int>&& p)
     60boost::interprocess::unique_ptr<int> f4(boost::interprocess::unique_ptr<int>&& p)
    5961{
    6062  boost::this_thread::sleep_for(ms(200));
     
    164166
    165167  {
    166     boost::future<boost::unique_ptr<int>> f = boost::async(f3, 3);
     168    boost::future<boost::interprocess::unique_ptr<int>> f = boost::async(f3, 3);
    167169    boost::this_thread::sleep_for(ms(300));
    168170    Clock::time_point t0 = Clock::now();
     
    173175
    174176  {
    175     boost::future<boost::unique_ptr<int>> f = boost::async(f4, boost::unique_ptr<int>(new int(3)));
     177    boost::future<boost::interprocess::unique_ptr<int>> f = boost::async(f4, boost::interprocess::unique_ptr<int>(new int(3)));
    176178    boost::this_thread::sleep_for(ms(300));
    177179    Clock::time_point t0 = Clock::now();
  • trunk/libs/thread/test/test_condition_notify_all.cpp

    r77849 r78802  
    1111
    1212#include <libs/thread/test/util.inl>
    13 #include "condition_test_common.hpp"
     13#include <libs/thread/test/condition_test_common.hpp>
    1414
    1515unsigned const number_of_test_threads=5;
  • trunk/libs/thread/test/test_condition_notify_one.cpp

    r77849 r78802  
    1111
    1212#include <libs/thread/test/util.inl>
    13 #include "condition_test_common.hpp"
     13#include <libs/thread/test/condition_test_common.hpp>
    1414
    1515void do_test_condition_notify_one_wakes_from_wait()
  • trunk/libs/thread/test/test_condition_timed_wait_times_out.cpp

    r77849 r78802  
    1010
    1111#include <boost/test/unit_test.hpp>
    12 #include "util.inl"
     12#include <libs/thread/test/util.inl>
    1313
    1414bool fake_predicate()
  • trunk/libs/thread/test/test_futures.cpp

    r78243 r78802  
    55//  http://www.boost.org/LICENSE_1_0.txt)
    66
    7 #include "boost/thread/thread.hpp"
    8 #include "boost/thread/mutex.hpp"
    9 #include "boost/thread/condition.hpp"
    10 #include "boost/thread/future.hpp"
     7#include <boost/thread/thread.hpp>
     8#include <boost/thread/mutex.hpp>
     9#include <boost/thread/condition.hpp>
     10#include <boost/thread/future.hpp>
    1111#include <utility>
    1212#include <memory>
  • trunk/libs/thread/test/test_ml.cpp

    r77870 r78802  
    33
    44#include <boost/detail/lightweight_test.hpp>
    5 #include "boost/thread/future.hpp"
    6 #include "boost/utility/result_of.hpp"
     5#include <boost/thread/future.hpp>
     6#include <boost/utility/result_of.hpp>
    77#include <functional>
    88
     
    117117/*
    118118 *
    119  * #include "boost/test/unit_test.hpp"
    120 #include "boost/thread/future.hpp"
    121 #include "boost/utility/result_of.hpp"
     119 * #include <boost/test/unit_test.hpp>
     120#include <boost/thread/future.hpp>
     121#include <boost/utility/result_of.hpp>
    122122#include <functional>
    123123
  • trunk/libs/thread/test/test_shared_mutex.cpp

    r77849 r78802  
    77#include <boost/thread/thread.hpp>
    88#include <boost/thread/xtime.hpp>
    9 #include "util.inl"
    10 #include "shared_mutex_locking_thread.hpp"
     9#include <libs/thread/test/util.inl>
     10#include <libs/thread/test/shared_mutex_locking_thread.hpp>
    1111
    1212#define CHECK_LOCKED_VALUE_EQUAL(mutex_name,value,expected_value)    \
  • trunk/libs/thread/test/test_shared_mutex_part_2.cpp

    r77849 r78802  
    77#include <boost/thread/thread.hpp>
    88#include <boost/thread/xtime.hpp>
    9 #include "util.inl"
    10 #include "shared_mutex_locking_thread.hpp"
     9#include <libs/thread/test/util.inl>
     10#include <libs/thread/test/shared_mutex_locking_thread.hpp>
    1111
    1212#define CHECK_LOCKED_VALUE_EQUAL(mutex_name,value,expected_value)    \
  • trunk/libs/thread/test/test_shared_mutex_timed_locks.cpp

    r77849 r78802  
    77#include <boost/thread/thread.hpp>
    88#include <boost/thread/xtime.hpp>
    9 #include "util.inl"
    10 #include "shared_mutex_locking_thread.hpp"
     9#include <libs/thread/test/util.inl>
     10#include <libs/thread/test/shared_mutex_locking_thread.hpp>
    1111
    1212#define CHECK_LOCKED_VALUE_EQUAL(mutex_name,value,expected_value)    \
  • trunk/libs/thread/test/test_shared_mutex_timed_locks_chrono.cpp

    r77849 r78802  
    77#include <boost/thread/thread.hpp>
    88#include <boost/thread/shared_mutex.hpp>
    9 #include "util.inl"
    10 #include "shared_mutex_locking_thread.hpp"
     9#include <libs/thread/test/util.inl>
     10#include <libs/thread/test/shared_mutex_locking_thread.hpp>
    1111
    1212#if defined BOOST_THREAD_USES_CHRONO
  • trunk/libs/thread/test/test_thread_exit.cpp

    r77849 r78802  
    55//  http://www.boost.org/LICENSE_1_0.txt)
    66
    7 #include "boost/thread/thread.hpp"
    8 #include "boost/thread/mutex.hpp"
    9 #include "boost/thread/condition.hpp"
    10 #include "boost/thread/future.hpp"
     7#include <boost/thread/thread.hpp>
     8#include <boost/thread/mutex.hpp>
     9#include <boost/thread/condition.hpp>
     10#include <boost/thread/future.hpp>
    1111#include <utility>
    1212#include <memory>
  • trunk/libs/thread/test/test_xtime.cpp

    r77849 r78802  
    1818    boost::xtime xt1, xt2, cur;
    1919    BOOST_CHECK_EQUAL(
    20         boost::xtime_get(&cur, boost::TIME_UTC),
    21         static_cast<int>(boost::TIME_UTC));
     20        boost::xtime_get(&cur, boost::TIME_UTC_),
     21        static_cast<int>(boost::TIME_UTC_));
    2222
    2323    xt1 = xt2 = cur;
     
    4343    BOOST_CHECK_EQUAL(
    4444        boost::xtime_get(&orig,
    45             boost::TIME_UTC), static_cast<int>(boost::TIME_UTC));
     45            boost::TIME_UTC_), static_cast<int>(boost::TIME_UTC_));
    4646    old = orig;
    4747
     
    4949    {
    5050        BOOST_CHECK_EQUAL(
    51             boost::xtime_get(&cur, boost::TIME_UTC),
    52             static_cast<int>(boost::TIME_UTC));
     51            boost::xtime_get(&cur, boost::TIME_UTC_),
     52            static_cast<int>(boost::TIME_UTC_));
    5353        BOOST_CHECK(boost::xtime_cmp(cur, orig) >= 0);
    5454        BOOST_CHECK(boost::xtime_cmp(cur, old) >= 0);
  • trunk/libs/thread/test/threads/this_thread/sleep_for/sleep_for_pass.cpp

    r77041 r78802  
    1818#include <boost/thread/thread.hpp>
    1919#include <cstdlib>
     20#include <algorithm>
    2021
    2122#include <boost/detail/lightweight_test.hpp>
     
    3637  // The time slept is within 1% of 500ms
    3738  // This test is spurious as it depends on the time the thread system switches the threads
    38   BOOST_TEST(std::abs(static_cast<long>(ns.count())) < (err+boost::chrono::milliseconds(1000)).count());
     39  BOOST_TEST(std::max(ns.count(), -ns.count()) < (err+boost::chrono::milliseconds(1000)).count());
     40  //BOOST_TEST(std::abs(static_cast<long>(ns.count())) < (err+boost::chrono::milliseconds(1000)).count());
    3941  return boost::report_errors();
    4042
  • trunk/libs/thread/test/threads/this_thread/sleep_until/sleep_until_pass.cpp

    r77041 r78802  
    1818#include <boost/thread/thread.hpp>
    1919#include <cstdlib>
     20#include <algorithm>
    2021
    2122#include <boost/detail/lightweight_test.hpp>
     
    3637  // The time slept is within 1% of 500ms
    3738  // This test is spurious as it depends on the time the thread system switches the threads
    38   BOOST_TEST(std::abs(static_cast<long>(ns.count())) < (err+boost::chrono::milliseconds(1000)).count());
     39  BOOST_TEST(std::max(ns.count(), -ns.count()) < (err+boost::chrono::milliseconds(1000)).count());
     40  //BOOST_TEST(std::abs(static_cast<long>(ns.count())) < (err+boost::chrono::milliseconds(1000)).count());
     41  return boost::report_errors();
    3942
    4043}
  • trunk/libs/thread/test/util.inl

    r77849 r78802  
    3131
    3232    boost::xtime xt;
    33     if (boost::TIME_UTC != boost::xtime_get (&xt, boost::TIME_UTC))
    34         BOOST_ERROR ("boost::xtime_get != boost::TIME_UTC");
     33    if (boost::TIME_UTC_ != boost::xtime_get (&xt, boost::TIME_UTC_))
     34        BOOST_ERROR ("boost::xtime_get != boost::TIME_UTC_");
    3535
    3636    nsecs += xt.nsec;
Note: See TracChangeset for help on using the changeset viewer.