os/ossrv/ossrv_pub/boost_apis/boost/thread/xtime.hpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/thread/xtime.hpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,54 @@
     1.4 +// Copyright (C) 2001-2003
     1.5 +// William E. Kempf
     1.6 +//
     1.7 +//  Distributed under the Boost Software License, Version 1.0. (See accompanying 
     1.8 +//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
     1.9 +
    1.10 +#ifndef BOOST_XTIME_WEK070601_HPP
    1.11 +#define BOOST_XTIME_WEK070601_HPP
    1.12 +
    1.13 +#include <boost/thread/detail/config.hpp>
    1.14 +
    1.15 +#include <boost/cstdint.hpp>
    1.16 +
    1.17 +namespace boost {
    1.18 +
    1.19 +enum xtime_clock_types
    1.20 +{
    1.21 +    TIME_UTC=1
    1.22 +//    TIME_TAI,
    1.23 +//    TIME_MONOTONIC,
    1.24 +//    TIME_PROCESS,
    1.25 +//    TIME_THREAD,
    1.26 +//    TIME_LOCAL,
    1.27 +//    TIME_SYNC,
    1.28 +//    TIME_RESOLUTION
    1.29 +};
    1.30 +
    1.31 +struct xtime
    1.32 +{
    1.33 +#if defined(BOOST_NO_INT64_T)
    1.34 +    typedef int_fast32_t xtime_sec_t; //INT_FAST32_MIN <= sec <= INT_FAST32_MAX
    1.35 +#else
    1.36 +    typedef int_fast64_t xtime_sec_t; //INT_FAST64_MIN <= sec <= INT_FAST64_MAX
    1.37 +#endif
    1.38 +
    1.39 +    typedef int_fast32_t xtime_nsec_t; //0 <= xtime.nsec < NANOSECONDS_PER_SECOND
    1.40 +
    1.41 +    xtime_sec_t sec;
    1.42 +    xtime_nsec_t nsec;
    1.43 +};
    1.44 +
    1.45 +int BOOST_THREAD_DECL xtime_get(struct xtime* xtp, int clock_type);
    1.46 +
    1.47 +inline int xtime_cmp(const xtime& xt1, const xtime& xt2)
    1.48 +{
    1.49 +    if (xt1.sec == xt2.sec)
    1.50 +        return (int)(xt1.nsec - xt2.nsec);
    1.51 +    else 
    1.52 +        return (xt1.sec > xt2.sec) ? 1 : -1;
    1.53 +}
    1.54 +
    1.55 +} // namespace boost
    1.56 +
    1.57 +#endif //BOOST_XTIME_WEK070601_HPP