From b7537c700a46d0c7c2c608eafc28c95de76b587b Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sun, 27 Feb 2022 11:21:46 +0800 Subject: [PATCH] minor changes --- source/util/src/tlog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 9fdbeba6d8..11b4555737 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -68,7 +68,7 @@ int8_t tscEmbeddedInUtil = 0; int32_t tsLogKeepDays = 0; bool tsAsyncLog = true; -bool tsLogInited = false; +int8_t tsLogInited = 0; int64_t asyncLogLostLines = 0; int32_t writeInterval = LOG_DEFAULT_INTERVAL; @@ -115,7 +115,7 @@ static int32_t taosStartLog() { } int32_t taosInitLog(const char *logName, int maxFiles) { - if (tsLogInited) return 0; + if (atomic_val_compare_exchange_8(&tsLogInited, 0, 1) != 0) return 0; osUpdate(); char fullName[PATH_MAX] = {0};