PageRenderTime 21ms CodeModel.GetById 15ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/Src/Dependencies/Boost/boost/asio/detail/null_thread.hpp

http://hadesmem.googlecode.com/
C++ Header | 63 lines | 37 code | 14 blank | 12 comment | 2 complexity | 00c8d0124f81897b7cc1e344a7c5bb48 MD5 | raw file
 1//
 2// detail/null_thread.hpp
 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_NULL_THREAD_HPP
12#define BOOST_ASIO_DETAIL_NULL_THREAD_HPP
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_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
21
22#include <boost/asio/detail/noncopyable.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
32class null_thread
33  : private noncopyable
34{
35public:
36  // Constructor.
37  template <typename Function>
38  null_thread(Function, unsigned int = 0)
39  {
40    boost::asio::detail::throw_error(
41        boost::asio::error::operation_not_supported, "thread");
42  }
43
44  // Destructor.
45  ~null_thread()
46  {
47  }
48
49  // Wait for the thread to exit.
50  void join()
51  {
52  }
53};
54
55} // namespace detail
56} // namespace asio
57} // namespace boost
58
59#include <boost/asio/detail/pop_options.hpp>
60
61#endif // !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
62
63#endif // BOOST_ASIO_DETAIL_NULL_THREAD_HPP