This commit is contained in:
Shengliang Guan 2021-02-01 15:39:45 +08:00
parent fd9847a25d
commit f441be13e4
5 changed files with 20 additions and 3 deletions

View File

@ -105,6 +105,8 @@ typedef int(*__compar_fn_t)(const void *, const void *);
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
#endif #endif
#define TAOS_OS_FUNC_PTHREAD_RWLOCK
int64_t tsosStr2int64(char *str); int64_t tsosStr2int64(char *str);
#include "eok.h" #include "eok.h"

View File

@ -28,6 +28,14 @@ extern "C" {
#define tsem_destroy sem_destroy #define tsem_destroy sem_destroy
#endif #endif
#ifdef TAOS_OS_FUNC_PTHREAD_RWLOCK
#define pthread_rwlock_t pthread_mutex_t
#define pthread_rwlock_init(lock) pthread_mutex_init(lock)
#define pthread_mutex_destroy(lock) pthread_mutex_destroy(lock)
#define pthread_rwlock_wrlock(lock) pthread_mutex_lock(lock)
#define pthread_rwlock_unlock(lock) pthread_mutex_unlock(lock)
#endif
// TAOS_OS_FUNC_SEMPHONE_PTHREAD // TAOS_OS_FUNC_SEMPHONE_PTHREAD
bool taosCheckPthreadValid(pthread_t thread); bool taosCheckPthreadValid(pthread_t thread);
int64_t taosGetSelfPthreadId(); int64_t taosGetSelfPthreadId();

View File

@ -27,7 +27,7 @@ int wordexp(char *words, wordexp_t *pwordexp, int flags) {
pwordexp->we_wordv[0] = pwordexp->wordPos; pwordexp->we_wordv[0] = pwordexp->wordPos;
memset(pwordexp->wordPos, 0, 1025); memset(pwordexp->wordPos, 0, 1025);
if (_fullpath(words, pwordexp->wordPos, 1024) == NULL) { if (_fullpath(pwordexp->wordPos, words, 1024) == NULL) {
pwordexp->we_wordv[0] = words; pwordexp->we_wordv[0] = words;
uError("failed to parse relative path:%s to abs path", words); uError("failed to parse relative path:%s to abs path", words);
return -1; return -1;

View File

@ -280,10 +280,12 @@ static int tsdbDropMetaRecord(STsdbFS *pfs, SMFile *pMFile, uint64_t uid) {
// =================== Commit Time-Series Data // =================== Commit Time-Series Data
static int tsdbCommitTSData(STsdbRepo *pRepo) { static int tsdbCommitTSData(STsdbRepo *pRepo) {
SMemTable *pMem = pRepo->imem; SMemTable *pMem = pRepo->imem;
SCommitH commith = {0}; SCommitH commith;
SDFileSet *pSet = NULL; SDFileSet *pSet = NULL;
int fid; int fid;
memset(&commith, 0, sizeof(SMemTable *));
if (pMem->numOfRows <= 0) { if (pMem->numOfRows <= 0) {
// No memory data, just apply retention on each file on disk // No memory data, just apply retention on each file on disk
if (tsdbApplyRtn(pRepo) < 0) { if (tsdbApplyRtn(pRepo) < 0) {

View File

@ -188,7 +188,11 @@ static void removeTimer(uintptr_t id) {
} }
static int64_t getMonotonicMs(void) { static int64_t getMonotonicMs(void) {
#ifdef WINDOWS
return (int64_t) getMonotonicUs() / 1000; return (int64_t) getMonotonicUs() / 1000;
#else
return taosGetTimestampMs();
#endif
} }
static void addToWheel(tmr_obj_t* timer, uint32_t delay) { static void addToWheel(tmr_obj_t* timer, uint32_t delay) {
@ -537,7 +541,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()); const char* ret = monotonicInit();
tmrInfo("ttimer monotonic clock source:%s", ret);
pthread_once(&tmrModuleInit, taosTmrModuleInit); pthread_once(&tmrModuleInit, taosTmrModuleInit);