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