summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/boost/asio/detail/keyword_tss_ptr.hpp')
-rw-r--r--3rdParty/Boost/src/boost/asio/detail/keyword_tss_ptr.hpp72
1 files changed, 72 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/asio/detail/keyword_tss_ptr.hpp b/3rdParty/Boost/src/boost/asio/detail/keyword_tss_ptr.hpp
new file mode 100644
index 0000000..10dd01a
--- /dev/null
+++ b/3rdParty/Boost/src/boost/asio/detail/keyword_tss_ptr.hpp
@@ -0,0 +1,72 @@
+//
+// detail/keyword_tss_ptr.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_KEYWORD_TSS_PTR_HPP
+#define BOOST_ASIO_DETAIL_KEYWORD_TSS_PTR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
+
+#include <boost/asio/detail/noncopyable.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+template <typename T>
+class keyword_tss_ptr
+ : private noncopyable
+{
+public:
+ // Constructor.
+ keyword_tss_ptr()
+ {
+ }
+
+ // Destructor.
+ ~keyword_tss_ptr()
+ {
+ }
+
+ // Get the value.
+ operator T*() const
+ {
+ return value_;
+ }
+
+ // Set the value.
+ void operator=(T* value)
+ {
+ value_ = value;
+ }
+
+private:
+ static __thread T* value_;
+};
+
+template <typename T>
+__thread T* keyword_tss_ptr<T>::value_;
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
+
+#endif // BOOST_ASIO_DETAIL_KEYWORD_TSS_PTR_HPP