Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

null_event.hpp 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. //
  2. // detail/null_event.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2019 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. #include "asio/detail/noncopyable.hpp"
  17. #include "asio/detail/push_options.hpp"
  18. namespace asio {
  19. namespace detail {
  20. class null_event
  21. : private noncopyable
  22. {
  23. public:
  24. // Constructor.
  25. null_event()
  26. {
  27. }
  28. // Destructor.
  29. ~null_event()
  30. {
  31. }
  32. // Signal the event. (Retained for backward compatibility.)
  33. template <typename Lock>
  34. void signal(Lock&)
  35. {
  36. }
  37. // Signal all waiters.
  38. template <typename Lock>
  39. void signal_all(Lock&)
  40. {
  41. }
  42. // Unlock the mutex and signal one waiter.
  43. template <typename Lock>
  44. void unlock_and_signal_one(Lock&)
  45. {
  46. }
  47. // If there's a waiter, unlock the mutex and signal it.
  48. template <typename Lock>
  49. bool maybe_unlock_and_signal_one(Lock&)
  50. {
  51. return false;
  52. }
  53. // Reset the event.
  54. template <typename Lock>
  55. void clear(Lock&)
  56. {
  57. }
  58. // Wait for the event to become signalled.
  59. template <typename Lock>
  60. void wait(Lock&)
  61. {
  62. do_wait();
  63. }
  64. // Timed wait for the event to become signalled.
  65. template <typename Lock>
  66. bool wait_for_usec(Lock&, long usec)
  67. {
  68. do_wait_for_usec(usec);
  69. return true;
  70. }
  71. private:
  72. ASIO_DECL static void do_wait();
  73. ASIO_DECL static void do_wait_for_usec(long usec);
  74. };
  75. } // namespace detail
  76. } // namespace asio
  77. #include "asio/detail/pop_options.hpp"
  78. #if defined(ASIO_HEADER_ONLY)
  79. # include "asio/detail/impl/null_event.ipp"
  80. #endif // defined(ASIO_HEADER_ONLY)
  81. #endif // ASIO_DETAIL_NULL_EVENT_HPP