spdlog/include/spdlog/details/console_globals.h

33 lines
609 B
C
Raw Normal View History

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