spdlog/include/spdlog/details/console_globals.h

33 lines
609 B
C
Raw Normal View History

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