PageRenderTime 32ms CodeModel.GetById 27ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/asio/detail/impl/posix_tss_ptr.ipp

http://hadesmem.googlecode.com/
C++ Header | 48 lines | 27 code | 12 blank | 9 comment | 2 complexity | 168b4426e552cc84e1105d799ae2a7b0 MD5 | raw file
 1//
 2// detail/impl/posix_tss_ptr.ipp
 3// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 4//
 5// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 6//
 7// Distributed under the Boost Software License, Version 1.0. (See accompanying
 8// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 9//
10
11#ifndef BOOST_ASIO_DETAIL_IMPL_POSIX_TSS_PTR_IPP
12#define BOOST_ASIO_DETAIL_IMPL_POSIX_TSS_PTR_IPP
13
14#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15# pragma once
16#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
18#include <boost/asio/detail/config.hpp>
19
20#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
21
22#include <boost/asio/detail/posix_tss_ptr.hpp>
23#include <boost/asio/detail/throw_error.hpp>
24#include <boost/asio/error.hpp>
25
26#include <boost/asio/detail/push_options.hpp>
27
28namespace boost {
29namespace asio {
30namespace detail {
31
32void posix_tss_ptr_create(pthread_key_t& key)
33{
34  int error = ::pthread_key_create(&key, 0);
35  boost::system::error_code ec(error,
36      boost::asio::error::get_system_category());
37  boost::asio::detail::throw_error(ec, "tss");
38}
39
40} // namespace detail
41} // namespace asio
42} // namespace boost
43
44#include <boost/asio/detail/pop_options.hpp>
45
46#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
47
48#endif // BOOST_ASIO_DETAIL_IMPL_POSIX_TSS_PTR_IPP