null_mutex.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // detail/null_mutex.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2023 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_MUTEX_HPP
  11. #define ASIO_DETAIL_NULL_MUTEX_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/scoped_lock.hpp"
  18. #include "asio/detail/push_options.hpp"
  19. namespace asio {
  20. namespace detail {
  21. class null_mutex
  22. : private noncopyable
  23. {
  24. public:
  25. typedef asio::detail::scoped_lock<null_mutex> scoped_lock;
  26. // Constructor.
  27. null_mutex()
  28. {
  29. }
  30. // Destructor.
  31. ~null_mutex()
  32. {
  33. }
  34. // Lock the mutex.
  35. void lock()
  36. {
  37. }
  38. // Unlock the mutex.
  39. void unlock()
  40. {
  41. }
  42. };
  43. } // namespace detail
  44. } // namespace asio
  45. #include "asio/detail/pop_options.hpp"
  46. #endif // ASIO_DETAIL_NULL_MUTEX_HPP