Index: detail/config.hpp =================================================================== --- detail/config.hpp (revision 77806) +++ detail/config.hpp (working copy) @@ -26,6 +26,10 @@ #define BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS #endif +//#if ! defined BOOST_THREAD_DONT_PROVIDE_BASIC_THREAD_ID +//#define BOOST_THREAD_PROVIDES_BASIC_THREAD_ID +//#endif + // Default version is 1 #if !defined BOOST_THREAD_VERSION #define BOOST_THREAD_VERSION 1 Index: detail/thread.hpp =================================================================== --- detail/thread.hpp (revision 77806) +++ detail/thread.hpp (working copy) @@ -649,19 +649,36 @@ std::size_t hash_value(const thread::id &v) { +#if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID + return hash_value(v.thread_data); +#else return hash_value(v.thread_data.get()); +#endif } - detail::thread_data_ptr thread_data; +#if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID + typedef thread::native_handle_type data; +#else + typedef detail::thread_data_ptr data; +#endif + data thread_data; - id(detail::thread_data_ptr thread_data_): + id(data thread_data_): thread_data(thread_data_) {} friend class thread; friend id BOOST_THREAD_DECL this_thread::get_id() BOOST_NOEXCEPT; public: id() BOOST_NOEXCEPT: - thread_data() +#if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID +#if defined(BOOST_THREAD_PLATFORM_WIN32) + thread_data(detail::win32::invalid_handle_value) +#else + thread_data(0) +#endif +#else + thread_data() +#endif {} id(const id& other) BOOST_NOEXCEPT : @@ -723,7 +740,8 @@ { if(thread_data) { - return os<handle_manager.handle()); + #else return thread::id((get_thread_info)()); + #endif } bool thread::joinable() const BOOST_NOEXCEPT @@ -537,7 +541,11 @@ thread::id get_id() BOOST_NOEXCEPT { + #if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID + return detail::win32::GetCurrentThread(); + #else return thread::id(get_or_make_current_thread_data()); + #endif } void interruption_point() Index: ../../libs/thread/src/pthread/thread.cpp =================================================================== --- ../../libs/thread/src/pthread/thread.cpp (revision 77806) +++ ../../libs/thread/src/pthread/thread.cpp (working copy) @@ -483,6 +483,10 @@ thread::id thread::get_id() const BOOST_NOEXCEPT { + #if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID + //return local_thread_info->thread_handle; + return native_handle(); + #else detail::thread_data_ptr const local_thread_info=(get_thread_info)(); if(local_thread_info) { @@ -490,8 +494,9 @@ } else { - return id(); + return id(); } + #endif } void thread::interrupt() @@ -543,8 +548,12 @@ { thread::id get_id() BOOST_NOEXCEPT { + #if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID + return pthread_self(); + #else boost::detail::thread_data_base* const thread_info=get_or_make_current_thread_data(); return thread::id(thread_info?thread_info->shared_from_this():detail::thread_data_ptr()); + #endif } void interruption_point()