2019-10-13 18:08:37 +02:00
|
|
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
2019-06-02 06:05:26 +02:00
|
|
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
2019-10-13 18:08:37 +02:00
|
|
|
|
|
|
|
#pragma once
|
2019-06-02 06:05:26 +02:00
|
|
|
|
|
|
|
#include "spdlog/details/null_mutex.h"
|
|
|
|
#include <mutex>
|
|
|
|
|
|
|
|
namespace spdlog {
|
|
|
|
namespace details {
|
|
|
|
|
|
|
|
struct console_mutex
|
|
|
|
{
|
|
|
|
using mutex_t = std::mutex;
|
|
|
|
static mutex_t &mutex()
|
|
|
|
{
|
|
|
|
static mutex_t s_mutex;
|
|
|
|
return s_mutex;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct console_nullmutex
|
|
|
|
{
|
|
|
|
using mutex_t = null_mutex;
|
|
|
|
static mutex_t &mutex()
|
|
|
|
{
|
|
|
|
static mutex_t s_mutex;
|
|
|
|
return s_mutex;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
} // namespace details
|
|
|
|
} // namespace spdlog
|