diff --git a/src/util/src/tskiplist.c b/src/util/src/tskiplist.c index 1bf63852884fad884cdb6a1f12dafc8277a72ed2..842ded19a652fdfad7cb6b35c536f760ae866618 100644 --- a/src/util/src/tskiplist.c +++ b/src/util/src/tskiplist.c @@ -546,7 +546,12 @@ static FORCE_INLINE int32_t getSkipListNodeRandomHeight(SSkipList *pSkipList) { const uint32_t factor = 4; int32_t n = 1; + +#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32) + while ((rand() % factor) == 0 && n <= pSkipList->maxLevel) { +#else while ((rand_r(&(pSkipList->seed)) % factor) == 0 && n <= pSkipList->maxLevel) { +#endif n++; }