Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:32:34

0001 // Copyright (C) 2001-2003
0002 // William E. Kempf
0003 // Copyright (C) 2011-2013 Vicente J. Botet Escriba
0004 //
0005 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
0006 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 
0008 #ifndef BOOST_THREAD_CONFIG_WEK01032003_HPP
0009 #define BOOST_THREAD_CONFIG_WEK01032003_HPP
0010 
0011 #include <boost/config.hpp>
0012 #include <boost/detail/workaround.hpp>
0013 #include <boost/thread/detail/platform.hpp>
0014 #include <boost/thread/detail/thread_safety.hpp>
0015 
0016 //#define BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS
0017 // ATTRIBUTE_MAY_ALIAS
0018 
0019 //#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
0020 #if !defined(BOOST_NO_MAY_ALIAS)
0021 
0022   // GCC since 3.3 and some other compilers have may_alias attribute that helps
0023   // to alleviate optimizer issues with regard to violation of the strict aliasing rules.
0024 
0025   #define BOOST_THREAD_DETAIL_USE_ATTRIBUTE_MAY_ALIAS
0026 #endif
0027 #if defined(BOOST_MAY_ALIAS)
0028 #define BOOST_THREAD_ATTRIBUTE_MAY_ALIAS BOOST_MAY_ALIAS
0029 #else
0030 #define BOOST_THREAD_ATTRIBUTE_MAY_ALIAS
0031 #endif
0032 
0033 #if defined(BOOST_THREAD_CHRONO_WINDOWS_API)
0034 # warning Boost.Thread will use the Windows API for time
0035 #elif defined(BOOST_THREAD_CHRONO_MAC_API)
0036 # warning Boost.Thread will use the Mac API  for time
0037 #elif defined(BOOST_THREAD_CHRONO_POSIX_API)
0038 # warning Boost.Thread will use the POSIX API  for time
0039 #endif
0040 
0041 # if defined( BOOST_THREAD_CHRONO_WINDOWS_API ) && defined( BOOST_THREAD_CHRONO_POSIX_API )
0042 #   error both BOOST_THREAD_CHRONO_WINDOWS_API and BOOST_THREAD_CHRONO_POSIX_API are defined
0043 # elif defined( BOOST_THREAD_CHRONO_WINDOWS_API ) && defined( BOOST_THREAD_CHRONO_MAC_API )
0044 #   error both BOOST_THREAD_CHRONO_WINDOWS_API and BOOST_THREAD_CHRONO_MAC_API are defined
0045 # elif defined( BOOST_THREAD_CHRONO_MAC_API ) && defined( BOOST_THREAD_CHRONO_POSIX_API )
0046 #   error both BOOST_THREAD_CHRONO_MAC_API and BOOST_THREAD_CHRONO_POSIX_API are defined
0047 # elif !defined( BOOST_THREAD_CHRONO_WINDOWS_API ) && !defined( BOOST_THREAD_CHRONO_MAC_API ) && !defined( BOOST_THREAD_CHRONO_POSIX_API )
0048 #   if defined(BOOST_THREAD_PLATFORM_WIN32)
0049 #     define BOOST_THREAD_CHRONO_WINDOWS_API
0050 #   elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
0051 #     define BOOST_THREAD_CHRONO_MAC_API
0052 #   else
0053 #     define BOOST_THREAD_CHRONO_POSIX_API
0054 #   endif
0055 # endif
0056 
0057 #if !defined(BOOST_THREAD_POLL_INTERVAL_MILLISECONDS)
0058 #define BOOST_THREAD_POLL_INTERVAL_MILLISECONDS 100
0059 #endif
0060 
0061 #if defined BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED
0062 #define BOOST_THREAD_ASSERT_PRECONDITION(EXPR, EX) \
0063         if (EXPR) {} else boost::throw_exception(EX)
0064 #define BOOST_THREAD_VERIFY_PRECONDITION(EXPR, EX) \
0065         if (EXPR) {} else boost::throw_exception(EX)
0066 #define BOOST_THREAD_THROW_ELSE_RETURN(EX, RET) \
0067         boost::throw_exception(EX)
0068 #else
0069 #define BOOST_THREAD_ASSERT_PRECONDITION(EXPR, EX)
0070 #define BOOST_THREAD_VERIFY_PRECONDITION(EXPR, EX) \
0071         (void)(EXPR)
0072 #define BOOST_THREAD_THROW_ELSE_RETURN(EX, RET) \
0073         return (RET)
0074 #endif
0075 
0076 // This compiler doesn't support Boost.Chrono
0077 #if defined __IBMCPP__ && (__IBMCPP__ < 1100) \
0078   && ! defined BOOST_THREAD_DONT_USE_CHRONO
0079 #define BOOST_THREAD_DONT_USE_CHRONO
0080 #if ! defined BOOST_THREAD_USES_DATETIME
0081 #define BOOST_THREAD_USES_DATETIME
0082 #endif
0083 #endif
0084 
0085 // This compiler doesn't support Boost.Move
0086 #if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100) \
0087   && ! defined BOOST_THREAD_DONT_USE_MOVE
0088 #define BOOST_THREAD_DONT_USE_MOVE
0089 #endif
0090 
0091 // This compiler doesn't support Boost.Container Allocators files
0092 #if defined __SUNPRO_CC \
0093   && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
0094 #define BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
0095 #endif
0096 
0097 #if defined _WIN32_WCE && _WIN32_WCE==0x501 \
0098   && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
0099 #define BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
0100 #endif
0101 
0102 
0103 #if defined BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX || defined BOOST_NO_CXX11_HDR_INITIALIZER_LIST
0104 #define BOOST_THREAD_NO_CXX11_HDR_INITIALIZER_LIST
0105 #define BOOST_THREAD_NO_MAKE_LOCK_GUARD
0106 #define BOOST_THREAD_NO_MAKE_STRICT_LOCK
0107 #define BOOST_THREAD_NO_MAKE_NESTED_STRICT_LOCK
0108 #endif
0109 
0110 #if defined(BOOST_NO_CXX11_HDR_TUPLE) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
0111 #define BOOST_THREAD_NO_MAKE_UNIQUE_LOCKS
0112 #define BOOST_THREAD_NO_SYNCHRONIZE
0113 #elif defined _MSC_VER && _MSC_VER <= 1600
0114 // C++ features supported by VC++ 10 (aka 2010)
0115 #define BOOST_THREAD_NO_MAKE_UNIQUE_LOCKS
0116 #define BOOST_THREAD_NO_SYNCHRONIZE
0117 #endif
0118 
0119 /// BASIC_THREAD_ID
0120 #if ! defined BOOST_THREAD_DONT_PROVIDE_BASIC_THREAD_ID \
0121  && ! defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
0122 #define BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
0123 #endif
0124 
0125 /// RVALUE_REFERENCES_DONT_MATCH_FUNTION_PTR
0126 //#if defined BOOST_NO_CXX11_RVALUE_REFERENCES || defined BOOST_MSVC
0127 #define BOOST_THREAD_RVALUE_REFERENCES_DONT_MATCH_FUNCTION_PTR
0128 //#endif
0129 
0130 // Default version
0131 #if !defined BOOST_THREAD_VERSION
0132 #define BOOST_THREAD_VERSION 2
0133 #else
0134 #if BOOST_THREAD_VERSION!=2  && BOOST_THREAD_VERSION!=3 && BOOST_THREAD_VERSION!=4 && BOOST_THREAD_VERSION!=5
0135 #error "BOOST_THREAD_VERSION must be 2, 3, 4 or 5"
0136 #endif
0137 #endif
0138 
0139 // CHRONO
0140 // Uses Boost.Chrono by default if not stated the opposite defining BOOST_THREAD_DONT_USE_CHRONO
0141 #if ! defined BOOST_THREAD_DONT_USE_CHRONO \
0142   && ! defined BOOST_THREAD_USES_CHRONO
0143 #define BOOST_THREAD_USES_CHRONO
0144 #endif
0145 
0146 #if ! defined BOOST_THREAD_DONT_USE_ATOMIC \
0147   && ! defined BOOST_THREAD_USES_ATOMIC
0148 #define BOOST_THREAD_USES_ATOMIC
0149 //#define BOOST_THREAD_DONT_USE_ATOMIC
0150 #endif
0151 
0152 #if defined BOOST_THREAD_USES_ATOMIC
0153 // Andrey Semashev
0154 #define BOOST_THREAD_ONCE_ATOMIC
0155 #else
0156 //#elif ! defined BOOST_NO_CXX11_THREAD_LOCAL && ! defined BOOST_NO_THREAD_LOCAL && ! defined BOOST_THREAD_NO_UINT32_PSEUDO_ATOMIC
0157 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2444.html#Appendix
0158 #define BOOST_THREAD_ONCE_FAST_EPOCH
0159 #endif
0160 #if BOOST_THREAD_VERSION==2
0161 
0162 // PROVIDE_PROMISE_LAZY
0163 #if ! defined BOOST_THREAD_DONT_PROVIDE_PROMISE_LAZY \
0164   && ! defined BOOST_THREAD_PROVIDES_PROMISE_LAZY
0165 #define BOOST_THREAD_PROVIDES_PROMISE_LAZY
0166 #endif
0167 
0168 // PROVIDE_THREAD_EQ
0169 #if ! defined BOOST_THREAD_DONT_PROVIDE_THREAD_EQ \
0170   && ! defined BOOST_THREAD_PROVIDES_THREAD_EQ
0171 #define BOOST_THREAD_PROVIDES_THREAD_EQ
0172 #endif
0173 
0174 #endif
0175 
0176 #if BOOST_THREAD_VERSION>=3
0177 
0178 // ONCE_CXX11
0179 // fixme BOOST_THREAD_PROVIDES_ONCE_CXX11 doesn't works when thread.cpp is compiled BOOST_THREAD_VERSION 3
0180 #if ! defined BOOST_THREAD_DONT_PROVIDE_ONCE_CXX11 \
0181  && ! defined BOOST_THREAD_PROVIDES_ONCE_CXX11
0182 #define BOOST_THREAD_DONT_PROVIDE_ONCE_CXX11
0183 #endif
0184 
0185 // THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
0186 #if ! defined BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE \
0187  && ! defined BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
0188 #define BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
0189 #endif
0190 
0191 // THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
0192 #if ! defined BOOST_THREAD_DONT_PROVIDE_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE \
0193  && ! defined BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
0194 #define BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
0195 #endif
0196 
0197 // PROVIDE_FUTURE
0198 #if ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE \
0199  && ! defined BOOST_THREAD_PROVIDES_FUTURE
0200 #define BOOST_THREAD_PROVIDES_FUTURE
0201 #endif
0202 
0203 // FUTURE_CTOR_ALLOCATORS
0204 #if ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS \
0205  && ! defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
0206 #define BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
0207 #endif
0208 
0209 // SHARED_MUTEX_UPWARDS_CONVERSIONS
0210 #if ! defined BOOST_THREAD_DONT_PROVIDE_SHARED_MUTEX_UPWARDS_CONVERSIONS \
0211  && ! defined BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
0212 #define BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
0213 #endif
0214 
0215 // PROVIDE_EXPLICIT_LOCK_CONVERSION
0216 #if ! defined BOOST_THREAD_DONT_PROVIDE_EXPLICIT_LOCK_CONVERSION \
0217  && ! defined BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
0218 #define BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
0219 #endif
0220 
0221 // GENERIC_SHARED_MUTEX_ON_WIN
0222 #if ! defined BOOST_THREAD_DONT_PROVIDE_GENERIC_SHARED_MUTEX_ON_WIN \
0223  && ! defined BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
0224 #define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
0225 #endif
0226 
0227 // USE_MOVE
0228 #if ! defined BOOST_THREAD_DONT_USE_MOVE \
0229  && ! defined BOOST_THREAD_USES_MOVE
0230 #define BOOST_THREAD_USES_MOVE
0231 #endif
0232 
0233 #endif
0234 
0235 // deprecated since version 4
0236 #if BOOST_THREAD_VERSION < 4
0237 
0238 // NESTED_LOCKS
0239 #if ! defined BOOST_THREAD_PROVIDES_NESTED_LOCKS \
0240  && ! defined BOOST_THREAD_DONT_PROVIDE_NESTED_LOCKS
0241 #define BOOST_THREAD_PROVIDES_NESTED_LOCKS
0242 #endif
0243 
0244 // CONDITION
0245 #if ! defined BOOST_THREAD_PROVIDES_CONDITION \
0246  && ! defined BOOST_THREAD_DONT_PROVIDE_CONDITION
0247 #define BOOST_THREAD_PROVIDES_CONDITION
0248 #endif
0249 
0250 // USE_DATETIME
0251 #if ! defined BOOST_THREAD_DONT_USE_DATETIME \
0252  && ! defined BOOST_THREAD_USES_DATETIME
0253 #define BOOST_THREAD_USES_DATETIME
0254 #endif
0255 #endif
0256 
0257 #if BOOST_THREAD_VERSION>=4
0258 
0259 // SIGNATURE_PACKAGED_TASK
0260 #if ! defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK \
0261  && ! defined BOOST_THREAD_DONT_PROVIDE_SIGNATURE_PACKAGED_TASK
0262 #define BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK
0263 #endif
0264 
0265 // VARIADIC_THREAD
0266 #if ! defined BOOST_THREAD_PROVIDES_VARIADIC_THREAD \
0267  && ! defined BOOST_THREAD_DONT_PROVIDE_VARIADIC_THREAD
0268 
0269 #if ! defined(BOOST_NO_SFINAE_EXPR) && \
0270     ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
0271     ! defined(BOOST_NO_CXX11_DECLTYPE) && \
0272     ! defined(BOOST_NO_CXX11_DECLTYPE_N3276) && \
0273     ! defined(BOOST_NO_CXX11_TRAILING_RESULT_TYPES) && \
0274     ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
0275     ! defined(BOOST_NO_CXX11_HDR_TUPLE)
0276 
0277 #define BOOST_THREAD_PROVIDES_VARIADIC_THREAD
0278 #endif
0279 #endif
0280 
0281 #if ! defined BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY \
0282  && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_WHEN_ALL_WHEN_ANY
0283 
0284 #if ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
0285     ! defined(BOOST_NO_CXX11_HDR_TUPLE)
0286 
0287 #define BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY
0288 #endif
0289 #endif
0290 
0291 //    ! defined(BOOST_NO_SFINAE_EXPR) &&
0292 //    ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) &&
0293 //    ! defined(BOOST_NO_CXX11_AUTO) &&
0294 //    ! defined(BOOST_NO_CXX11_DECLTYPE) &&
0295 //    ! defined(BOOST_NO_CXX11_DECLTYPE_N3276) &&
0296 
0297 
0298 // MAKE_READY_AT_THREAD_EXIT
0299 #if ! defined BOOST_THREAD_PROVIDES_MAKE_READY_AT_THREAD_EXIT \
0300  && ! defined BOOST_THREAD_DONT_PROVIDE_MAKE_READY_AT_THREAD_EXIT
0301 
0302 //#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
0303 #define BOOST_THREAD_PROVIDES_MAKE_READY_AT_THREAD_EXIT
0304 //#endif
0305 #endif
0306 
0307 // FUTURE_CONTINUATION
0308 #if ! defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION \
0309  && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_CONTINUATION
0310 #define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
0311 #endif
0312 
0313 #if ! defined BOOST_THREAD_PROVIDES_FUTURE_UNWRAP \
0314  && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_UNWRAP
0315 #define BOOST_THREAD_PROVIDES_FUTURE_UNWRAP
0316 #endif
0317 
0318 // FUTURE_INVALID_AFTER_GET
0319 #if ! defined BOOST_THREAD_PROVIDES_FUTURE_INVALID_AFTER_GET \
0320  && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_INVALID_AFTER_GET
0321 #define BOOST_THREAD_PROVIDES_FUTURE_INVALID_AFTER_GET
0322 #endif
0323 
0324 // NESTED_LOCKS
0325 #if ! defined BOOST_THREAD_PROVIDES_NESTED_LOCKS \
0326  && ! defined BOOST_THREAD_DONT_PROVIDE_NESTED_LOCKS
0327 #define BOOST_THREAD_DONT_PROVIDE_NESTED_LOCKS
0328 #endif
0329 
0330 // CONDITION
0331 #if ! defined BOOST_THREAD_PROVIDES_CONDITION \
0332  && ! defined BOOST_THREAD_DONT_PROVIDE_CONDITION
0333 #define BOOST_THREAD_DONT_PROVIDE_CONDITION
0334 #endif
0335 
0336 #endif // BOOST_THREAD_VERSION>=4
0337 
0338 
0339 #if BOOST_THREAD_VERSION>=5
0340 //#define BOOST_THREAD_FUTURE_BLOCKING
0341 
0342 #if ! defined BOOST_THREAD_PROVIDES_EXECUTORS \
0343  && ! defined BOOST_THREAD_DONT_PROVIDE_EXECUTORS
0344 #define BOOST_THREAD_PROVIDES_EXECUTORS
0345 #endif
0346 
0347 #else
0348 //#define BOOST_THREAD_FUTURE_BLOCKING
0349 #define BOOST_THREAD_ASYNC_FUTURE_WAITS
0350 #endif
0351 
0352 
0353 // INTERRUPTIONS
0354 #if ! defined BOOST_THREAD_PROVIDES_INTERRUPTIONS \
0355  && ! defined BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS
0356 #define BOOST_THREAD_PROVIDES_INTERRUPTIONS
0357 #endif
0358 
0359 // CORRELATIONS
0360 
0361 // EXPLICIT_LOCK_CONVERSION.
0362 #if defined BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
0363 #define BOOST_THREAD_EXPLICIT_LOCK_CONVERSION explicit
0364 #else
0365 #define BOOST_THREAD_EXPLICIT_LOCK_CONVERSION
0366 #endif
0367 
0368 // BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN is defined if BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
0369 #if defined BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS \
0370 && ! defined BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
0371 #define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
0372 #endif
0373 
0374 // For C++11 call_once interface the compiler MUST support constexpr.
0375 // Otherwise once_flag would be initialized during dynamic initialization stage, which is not thread-safe.
0376 #if defined(BOOST_THREAD_PROVIDES_ONCE_CXX11)
0377 #if defined(BOOST_NO_CXX11_CONSTEXPR)
0378 #undef BOOST_THREAD_PROVIDES_ONCE_CXX11
0379 #endif
0380 #endif
0381 
0382 #if defined(BOOST_THREAD_PLATFORM_WIN32) && defined BOOST_THREAD_DONT_USE_DATETIME
0383 #undef BOOST_THREAD_DONT_USE_DATETIME
0384 #define BOOST_THREAD_USES_DATETIME
0385 #endif
0386 
0387 #if defined(BOOST_THREAD_PLATFORM_WIN32) && defined BOOST_THREAD_DONT_USE_CHRONO
0388 #undef BOOST_THREAD_DONT_USE_CHRONO
0389 #define BOOST_THREAD_USES_CHRONO
0390 #endif
0391 
0392 // BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 defined by default up to Boost 1.55
0393 // BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0 defined by default up to Boost 1.55
0394 #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
0395 
0396 #if  ! defined BOOST_THREAD_PROVIDES_THREAD_EQ
0397 #define BOOST_THREAD_PROVIDES_THREAD_EQ
0398 #endif
0399 
0400 #endif
0401 
0402 
0403 //#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES || defined BOOST_THREAD_USES_MOVE
0404 #if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
0405 #define BOOST_THREAD_FUTURE_USES_OPTIONAL
0406 #endif
0407 
0408 #if BOOST_WORKAROUND(BOOST_BORLANDC, < 0x600)
0409 #  pragma warn -8008 // Condition always true/false
0410 #  pragma warn -8080 // Identifier declared but never used
0411 #  pragma warn -8057 // Parameter never used
0412 #  pragma warn -8066 // Unreachable code
0413 #endif
0414 
0415 #include <boost/thread/detail/platform.hpp>
0416 
0417 #if defined(BOOST_THREAD_PLATFORM_WIN32)
0418 #else
0419   #   if defined(BOOST_HAS_PTHREAD_DELAY_NP) || defined(BOOST_HAS_NANOSLEEP)
0420   #     define BOOST_THREAD_SLEEP_FOR_IS_STEADY
0421   #   endif
0422 #endif
0423 
0424 #if defined(BOOST_THREAD_CHRONO_WINDOWS_API)
0425   #define BOOST_THREAD_HAS_MONO_CLOCK
0426   #define BOOST_THREAD_INTERNAL_CLOCK_IS_MONO
0427 #elif defined(BOOST_THREAD_CHRONO_MAC_API)
0428   #define BOOST_THREAD_HAS_MONO_CLOCK
0429 #elif defined(__ANDROID__)
0430   #define BOOST_THREAD_HAS_MONO_CLOCK
0431   #if defined(__ANDROID_API__) && __ANDROID_API__ >= 21
0432     #define BOOST_THREAD_INTERNAL_CLOCK_IS_MONO
0433   #endif
0434 #else
0435   #include <time.h> // check for CLOCK_MONOTONIC
0436   #if defined(CLOCK_MONOTONIC)
0437     #define BOOST_THREAD_HAS_MONO_CLOCK
0438     #define BOOST_THREAD_INTERNAL_CLOCK_IS_MONO
0439   #endif
0440 #endif
0441 
0442 #if defined(BOOST_THREAD_PLATFORM_WIN32)
0443 #elif ! defined BOOST_THREAD_INTERNAL_CLOCK_IS_MONO
0444 #if defined BOOST_PTHREAD_HAS_TIMEDLOCK
0445 #define BOOST_THREAD_USES_PTHREAD_TIMEDLOCK
0446 #elif (defined(_POSIX_TIMEOUTS) && (_POSIX_TIMEOUTS-0)>=200112L) \
0447  || (defined(__ANDROID__) && defined(__ANDROID_API__) && __ANDROID_API__ >= 21)
0448 #define BOOST_THREAD_USES_PTHREAD_TIMEDLOCK
0449 #endif
0450 #endif
0451 
0452 // provided for backwards compatibility, since this
0453 // macro was used for several releases by mistake.
0454 #if defined(BOOST_THREAD_DYN_DLL) && ! defined(BOOST_THREAD_DYN_LINK)
0455 # define BOOST_THREAD_DYN_LINK
0456 #endif
0457 
0458 // compatibility with the rest of Boost's auto-linking code:
0459 #if defined(BOOST_THREAD_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)
0460 # undef  BOOST_THREAD_USE_LIB
0461 # if !defined(BOOST_THREAD_USE_DLL)
0462 #  define BOOST_THREAD_USE_DLL
0463 # endif
0464 #endif
0465 
0466 #if defined(BOOST_THREAD_BUILD_DLL)   //Build dll
0467 #elif defined(BOOST_THREAD_BUILD_LIB) //Build lib
0468 #elif defined(BOOST_THREAD_USE_DLL)   //Use dll
0469 #elif defined(BOOST_THREAD_USE_LIB)   //Use lib
0470 #else //Use default
0471 #   if defined(BOOST_THREAD_PLATFORM_WIN32)
0472 #       if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN) \
0473       || defined(__MINGW32__) || defined(MINGW32) || defined(BOOST_MINGW32) \
0474       || (defined(_MSC_VER) && defined(__clang__))
0475       //For compilers supporting auto-tss cleanup
0476             //with Boost.Threads lib, use Boost.Threads lib
0477 #           define BOOST_THREAD_USE_LIB
0478 #       else
0479             //For compilers not yet supporting auto-tss cleanup
0480             //with Boost.Threads lib, use Boost.Threads dll
0481 #           define BOOST_THREAD_USE_DLL
0482 #       endif
0483 #   else
0484 #       define BOOST_THREAD_USE_LIB
0485 #   endif
0486 #endif
0487 
0488 #if defined(BOOST_HAS_DECLSPEC)
0489 #   if defined(BOOST_THREAD_BUILD_DLL) //Build dll
0490 #       define BOOST_THREAD_DECL BOOST_SYMBOL_EXPORT
0491 //#       define BOOST_THREAD_DECL __declspec(dllexport)
0492 
0493 #   elif defined(BOOST_THREAD_USE_DLL) //Use dll
0494 #       define BOOST_THREAD_DECL BOOST_SYMBOL_IMPORT
0495 //#       define BOOST_THREAD_DECL __declspec(dllimport)
0496 #   else
0497 #       define BOOST_THREAD_DECL
0498 #   endif
0499 #elif (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
0500 #  define BOOST_THREAD_DECL BOOST_SYMBOL_VISIBLE
0501 
0502 #else
0503 #   define BOOST_THREAD_DECL
0504 #endif // BOOST_HAS_DECLSPEC
0505 
0506 //
0507 // Automatically link to the correct build variant where possible.
0508 //
0509 #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_THREAD_NO_LIB) && !defined(BOOST_THREAD_BUILD_DLL) && !defined(BOOST_THREAD_BUILD_LIB)
0510 //
0511 // Tell the autolink to link dynamically, this will get undef'ed by auto_link.hpp
0512 // once it's done with it:
0513 //
0514 #if defined(BOOST_THREAD_USE_DLL) &  ! defined(BOOST_DYN_LINK)
0515 #   define BOOST_DYN_LINK
0516 #endif
0517 //
0518 // Set the name of our library, this will get undef'ed by auto_link.hpp
0519 // once it's done with it:
0520 //
0521 #if defined(BOOST_THREAD_LIB_NAME)
0522 #    define BOOST_LIB_NAME BOOST_THREAD_LIB_NAME
0523 #else
0524 #    define BOOST_LIB_NAME boost_thread
0525 #endif
0526 //
0527 // If we're importing code from a dll, then tell auto_link.hpp about it:
0528 //
0529 // And include the header that does the work:
0530 //
0531 #include <boost/config/auto_link.hpp>
0532 #endif  // auto-linking disabled
0533 
0534 #endif // BOOST_THREAD_CONFIG_WEK1032003_HPP
0535 
0536 // Change Log:
0537 //   22 Jan 05 Roland Schwarz (speedsnail)
0538 //      Usage of BOOST_HAS_DECLSPEC macro.
0539 //      Default again is static lib usage.
0540 //      BOOST_DYN_LINK only defined when autolink included.