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.

33 lines
609B

  1. // Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
  2. // Distributed under the MIT License (http://opensource.org/licenses/MIT)
  3. #pragma once
  4. #include "spdlog/details/null_mutex.h"
  5. #include <mutex>
  6. namespace spdlog {
  7. namespace details {
  8. struct console_mutex
  9. {
  10. using mutex_t = std::mutex;
  11. static mutex_t &mutex()
  12. {
  13. static mutex_t s_mutex;
  14. return s_mutex;
  15. }
  16. };
  17. struct console_nullmutex
  18. {
  19. using mutex_t = null_mutex;
  20. static mutex_t &mutex()
  21. {
  22. static mutex_t s_mutex;
  23. return s_mutex;
  24. }
  25. };
  26. } // namespace details
  27. } // namespace spdlog