提交 ea981d08 编写于 作者: M Minglei Jin

monotonic/msvclibx: fix compilation on linux

上级 b834fb6f
...@@ -2,6 +2,10 @@ AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src SOURCE_LIST) ...@@ -2,6 +2,10 @@ AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src SOURCE_LIST)
add_definitions(-DUSE_PROCESSOR_CLOCK) add_definitions(-DUSE_PROCESSOR_CLOCK)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../MsvcLibX/include)
ADD_LIBRARY(rmonotonic ${SOURCE_LIST}) ADD_LIBRARY(rmonotonic ${SOURCE_LIST})
TARGET_INCLUDE_DIRECTORIES(rmonotonic PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inc) TARGET_INCLUDE_DIRECTORIES(rmonotonic PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inc)
TARGET_LINK_LIBRARIES(rmonotonic MsvcLibXw) IF (TD_WINDOWS)
TARGET_LINK_LIBRARIES(rmonotonic MsvcLibXw)
ENDIF ()
...@@ -7,8 +7,10 @@ ...@@ -7,8 +7,10 @@
#undef NDEBUG #undef NDEBUG
#include <assert.h> #include <assert.h>
#if defined(_WIN32) || defined(_WIN64)
#include "msvcTime.h" #include "msvcTime.h"
#include "msvcStdio.h" #include "msvcStdio.h"
#endif
/* The function pointer for clock retrieval. */ /* The function pointer for clock retrieval. */
monotime (*getMonotonicUs)(void) = NULL; monotime (*getMonotonicUs)(void) = NULL;
......
...@@ -506,7 +506,6 @@ static void taosTmrModuleInit(void) { ...@@ -506,7 +506,6 @@ static void taosTmrModuleInit(void) {
pthread_mutex_init(&tmrCtrlMutex, NULL); pthread_mutex_init(&tmrCtrlMutex, NULL);
tmrInfo("ttimer monotonic clock source:%s", monotonicInit());
int64_t now = getMonotonicMs(); int64_t now = getMonotonicMs();
for (int i = 0; i < tListLen(wheels); i++) { for (int i = 0; i < tListLen(wheels); i++) {
time_wheel_t* wheel = wheels + i; time_wheel_t* wheel = wheels + i;
...@@ -538,6 +537,8 @@ static void taosTmrModuleInit(void) { ...@@ -538,6 +537,8 @@ static void taosTmrModuleInit(void) {
} }
void* taosTmrInit(int maxNumOfTmrs, int resolution, int longest, const char* label) { void* taosTmrInit(int maxNumOfTmrs, int resolution, int longest, const char* label) {
tmrInfo("ttimer monotonic clock source:%s", monotonicInit());
pthread_once(&tmrModuleInit, taosTmrModuleInit); pthread_once(&tmrModuleInit, taosTmrModuleInit);
pthread_mutex_lock(&tmrCtrlMutex); pthread_mutex_lock(&tmrCtrlMutex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册