monotonic/msvclibx: fix compilation on linux
This commit is contained in:
parent
b834fb6f37
commit
ea981d0806
|
@ -2,6 +2,10 @@ AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src SOURCE_LIST)
|
|||
|
||||
add_definitions(-DUSE_PROCESSOR_CLOCK)
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../MsvcLibX/include)
|
||||
|
||||
ADD_LIBRARY(rmonotonic ${SOURCE_LIST})
|
||||
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 @@
|
|||
#undef NDEBUG
|
||||
#include <assert.h>
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include "msvcTime.h"
|
||||
#include "msvcStdio.h"
|
||||
#endif
|
||||
|
||||
/* The function pointer for clock retrieval. */
|
||||
monotime (*getMonotonicUs)(void) = NULL;
|
||||
|
|
|
@ -506,7 +506,6 @@ static void taosTmrModuleInit(void) {
|
|||
|
||||
pthread_mutex_init(&tmrCtrlMutex, NULL);
|
||||
|
||||
tmrInfo("ttimer monotonic clock source:%s", monotonicInit());
|
||||
int64_t now = getMonotonicMs();
|
||||
for (int i = 0; i < tListLen(wheels); i++) {
|
||||
time_wheel_t* wheel = wheels + i;
|
||||
|
@ -538,6 +537,8 @@ static void taosTmrModuleInit(void) {
|
|||
}
|
||||
|
||||
void* taosTmrInit(int maxNumOfTmrs, int resolution, int longest, const char* label) {
|
||||
tmrInfo("ttimer monotonic clock source:%s", monotonicInit());
|
||||
|
||||
pthread_once(&tmrModuleInit, taosTmrModuleInit);
|
||||
|
||||
pthread_mutex_lock(&tmrCtrlMutex);
|
||||
|
|
Loading…
Reference in New Issue