summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/boost/asio/detail/posix_tss_ptr.hpp')
-rw-r--r--3rdParty/Boost/src/boost/asio/detail/posix_tss_ptr.hpp42
1 files changed, 17 insertions, 25 deletions
diff --git a/3rdParty/Boost/src/boost/asio/detail/posix_tss_ptr.hpp b/3rdParty/Boost/src/boost/asio/detail/posix_tss_ptr.hpp
index c83df96..dfe8369 100644
--- a/3rdParty/Boost/src/boost/asio/detail/posix_tss_ptr.hpp
+++ b/3rdParty/Boost/src/boost/asio/detail/posix_tss_ptr.hpp
@@ -1,6 +1,6 @@
//
-// posix_tss_ptr.hpp
-// ~~~~~~~~~~~~~~~~~
+// detail/posix_tss_ptr.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,27 +15,22 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
-
-#include <boost/asio/detail/push_options.hpp>
-#include <boost/config.hpp>
-#include <boost/system/system_error.hpp>
-#include <boost/asio/detail/pop_options.hpp>
+#include <boost/asio/detail/config.hpp>
-#if defined(BOOST_HAS_PTHREADS)
+#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
-#include <boost/asio/detail/push_options.hpp>
-#include <boost/throw_exception.hpp>
#include <pthread.h>
-#include <boost/asio/detail/pop_options.hpp>
-
-#include <boost/asio/error.hpp>
#include <boost/asio/detail/noncopyable.hpp>
+#include <boost/asio/detail/push_options.hpp>
+
namespace boost {
namespace asio {
namespace detail {
+// Helper function to create thread-specific storage.
+BOOST_ASIO_DECL void posix_tss_ptr_create(pthread_key_t& key);
+
template <typename T>
class posix_tss_ptr
: private noncopyable
@@ -44,15 +39,7 @@ public:
// Constructor.
posix_tss_ptr()
{
- int error = ::pthread_key_create(&tss_key_, 0);
- if (error != 0)
- {
- boost::system::system_error e(
- boost::system::error_code(error,
- boost::asio::error::get_system_category()),
- "tss");
- boost::throw_exception(e);
- }
+ posix_tss_ptr_create(tss_key_);
}
// Destructor.
@@ -77,14 +64,19 @@ private:
// Thread-specific storage to allow unlocked access to determine whether a
// thread is a member of the pool.
pthread_key_t tss_key_;
+
};
} // namespace detail
} // namespace asio
} // namespace boost
-#endif // defined(BOOST_HAS_PTHREADS)
-
#include <boost/asio/detail/pop_options.hpp>
+#if defined(BOOST_ASIO_HEADER_ONLY)
+# include <boost/asio/detail/impl/posix_tss_ptr.ipp>
+#endif // defined(BOOST_ASIO_HEADER_ONLY)
+
+#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+
#endif // BOOST_ASIO_DETAIL_POSIX_TSS_PTR_HPP