mirror of https://github.com/Icinga/icinga2.git
Merge pull request #9827 from Icinga/application-m_lastreloadfailed-uint32_t
Application::m_LastReloadFailed: if double isn't always lock free, use uint32_t
This commit is contained in:
commit
1df14d60d2
|
@ -9,7 +9,9 @@
|
||||||
#include "base/logger.hpp"
|
#include "base/logger.hpp"
|
||||||
#include "base/configuration.hpp"
|
#include "base/configuration.hpp"
|
||||||
#include "base/shared-memory.hpp"
|
#include "base/shared-memory.hpp"
|
||||||
|
#include <cstdint>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
namespace icinga
|
namespace icinga
|
||||||
{
|
{
|
||||||
|
@ -142,7 +144,7 @@ private:
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
static double m_LastReloadFailed;
|
static double m_LastReloadFailed;
|
||||||
#else /* _WIN32 */
|
#else /* _WIN32 */
|
||||||
typedef Atomic<double> AtomicTs;
|
typedef Atomic<std::conditional_t<Atomic<double>::is_always_lock_free, double, uint32_t>> AtomicTs;
|
||||||
static_assert(AtomicTs::is_always_lock_free);
|
static_assert(AtomicTs::is_always_lock_free);
|
||||||
static SharedMemory<AtomicTs> m_LastReloadFailed;
|
static SharedMemory<AtomicTs> m_LastReloadFailed;
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
Loading…
Reference in New Issue