null_event.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // detail/null_event.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. #ifndef ASIO_DETAIL_NULL_EVENT_HPP
  11. #define ASIO_DETAIL_NULL_EVENT_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include "asio/detail/config.hpp"
  16. #if !defined(BOOST_HAS_THREADS) || defined(ASIO_DISABLE_THREADS)
  17. #include "asio/detail/noncopyable.hpp"
  18. #include "asio/detail/push_options.hpp"
  19. namespace asio {
  20. namespace detail {
  21. class null_event
  22. : private noncopyable
  23. {
  24. public:
  25. // Constructor.
  26. null_event()
  27. {
  28. }
  29. // Destructor.
  30. ~null_event()
  31. {
  32. }
  33. // Signal the event.
  34. template <typename Lock>
  35. void signal(Lock&)
  36. {
  37. }
  38. // Signal the event and unlock the mutex.
  39. template <typename Lock>
  40. void signal_and_unlock(Lock&)
  41. {
  42. }
  43. // Reset the event.
  44. template <typename Lock>
  45. void clear(Lock&)
  46. {
  47. }
  48. // Wait for the event to become signalled.
  49. template <typename Lock>
  50. void wait(Lock&)
  51. {
  52. }
  53. };
  54. } // namespace detail
  55. } // namespace asio
  56. #include "asio/detail/pop_options.hpp"
  57. #endif // !defined(BOOST_HAS_THREADS) || defined(ASIO_DISABLE_THREADS)
  58. #endif // ASIO_DETAIL_NULL_EVENT_HPP