2019-06-03 17:09:16 -04:00
|
|
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
2018-04-17 19:04:10 -04:00
|
|
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
2019-05-11 13:06:17 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2018-07-14 09:21:53 -04:00
|
|
|
#include "spdlog/details/null_mutex.h"
|
|
|
|
#include <mutex>
|
|
|
|
|
2018-04-17 19:04:10 -04:00
|
|
|
namespace spdlog {
|
2018-04-20 06:20:19 -04:00
|
|
|
namespace details {
|
2018-04-17 19:04:10 -04:00
|
|
|
|
2018-07-14 09:21:53 -04:00
|
|
|
struct console_mutex
|
2018-04-20 06:20:19 -04:00
|
|
|
{
|
|
|
|
using mutex_t = std::mutex;
|
2018-07-14 09:21:53 -04:00
|
|
|
static mutex_t &mutex()
|
2018-04-20 06:20:19 -04:00
|
|
|
{
|
2018-07-14 09:21:53 -04:00
|
|
|
static mutex_t s_mutex;
|
|
|
|
return s_mutex;
|
2018-04-20 06:20:19 -04:00
|
|
|
}
|
|
|
|
};
|
2018-04-17 19:04:10 -04:00
|
|
|
|
2018-07-14 09:21:53 -04:00
|
|
|
struct console_nullmutex
|
2018-04-20 06:20:19 -04:00
|
|
|
{
|
|
|
|
using mutex_t = null_mutex;
|
2018-07-14 09:21:53 -04:00
|
|
|
static mutex_t &mutex()
|
2018-04-20 06:20:19 -04:00
|
|
|
{
|
2018-07-14 09:21:53 -04:00
|
|
|
static mutex_t s_mutex;
|
|
|
|
return s_mutex;
|
2018-04-20 06:20:19 -04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
} // namespace details
|
|
|
|
} // namespace spdlog
|