1//
2// detail/impl/posix_event.ipp
3// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
4//
5// Copyright (c) 2003-2015 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 ASIO_DETAIL_IMPL_POSIX_EVENT_IPP
12#define ASIO_DETAIL_IMPL_POSIX_EVENT_IPP
13
14
15#include "asio/detail/config.hpp"
16
17#if defined(ASIO_HAS_PTHREADS)
18
19#include "asio/detail/posix_event.hpp"
20#include "asio/detail/throw_error.hpp"
21#include "asio/error.hpp"
22
23#include "asio/detail/push_options.hpp"
24
25namespace asio {
26namespace detail {
27
28posix_event::posix_event()
29  : state_(0)
30{
31  int error = ::pthread_cond_init(&cond_, 0);
32  asio::error_code ec(error,
33      asio::error::get_system_category());
34  asio::detail::throw_error(ec, "event");
35}
36
37} // namespace detail
38} // namespace asio
39
40#include "asio/detail/pop_options.hpp"
41
42#endif // defined(ASIO_HAS_PTHREADS)
43
44#endif // ASIO_DETAIL_IMPL_POSIX_EVENT_IPP
45