]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/asio/include/boost/asio/detail/impl/posix_event.ipp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / asio / include / boost / asio / detail / impl / posix_event.ipp
1 //
2 // detail/impl/posix_event.ipp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2016 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_EVENT_IPP
12 #define BOOST_ASIO_DETAIL_IMPL_POSIX_EVENT_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_ASIO_HAS_PTHREADS)
21
22 #include <boost/asio/detail/posix_event.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
28 namespace boost {
29 namespace asio {
30 namespace detail {
31
32 posix_event::posix_event()
33 : state_(0)
34 {
35 int error = ::pthread_cond_init(&cond_, 0);
36 boost::system::error_code ec(error,
37 boost::asio::error::get_system_category());
38 boost::asio::detail::throw_error(ec, "event");
39 }
40
41 } // namespace detail
42 } // namespace asio
43 } // namespace boost
44
45 #include <boost/asio/detail/pop_options.hpp>
46
47 #endif // defined(BOOST_ASIO_HAS_PTHREADS)
48
49 #endif // BOOST_ASIO_DETAIL_IMPL_POSIX_EVENT_IPP