From 6cc03afdf98568fbe4714160996b1a609fa650f5 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 12 Jun 2018 08:37:46 +0300 Subject: [PATCH] MXS-1908 Reorder the code slightly --- server/core/log_manager.cc | 45 +++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/server/core/log_manager.cc b/server/core/log_manager.cc index 1841d04e6..392eebd1f 100644 --- a/server/core/log_manager.cc +++ b/server/core/log_manager.cc @@ -190,9 +190,29 @@ struct filewriter #endif }; +/** + * Returns the current time. + * + * @return Current monotonic raw time in milliseconds. + */ +static uint64_t time_monotonic_ms() +{ + struct timespec now; + clock_gettime(CLOCK_MONOTONIC, &now); + + return now.tv_sec * 1000 + now.tv_nsec / 1000000; +} + namespace { +typedef enum message_suppression +{ + MESSAGE_NOT_SUPPRESSED, // Message is not suppressed. + MESSAGE_SUPPRESSED, // Message is suppressed for the first time (for this round) + MESSAGE_STILL_SUPPRESSED // Message is still suppressed (for this round) +} message_suppression_t; + class MessageRegistryKey { public: @@ -252,31 +272,6 @@ public: } }; -} - -/** - * Returns the current time. - * - * @return Current monotonic raw time in milliseconds. - */ -static uint64_t time_monotonic_ms() -{ - struct timespec now; - clock_gettime(CLOCK_MONOTONIC, &now); - - return now.tv_sec * 1000 + now.tv_nsec / 1000000; -} - -namespace -{ - -typedef enum message_suppression -{ - MESSAGE_NOT_SUPPRESSED, // Message is not suppressed. - MESSAGE_SUPPRESSED, // Message is suppressed for the first time (for this round) - MESSAGE_STILL_SUPPRESSED // Message is still suppressed (for this round) -} message_suppression_t; - class MessageRegistryStats { public: