Merge pull request #18613 from taosdata/FIX/xsren/TD-20738-timewait

fix:window time wait
This commit is contained in:
Shengliang Guan 2022-12-02 08:01:52 +08:00 committed by GitHub
commit 8efb45ffbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 12 deletions

View File

@ -75,20 +75,16 @@ int32_t tsem_wait(tsem_t* sem) {
return ret;
}
int32_t tsem_timewait(tsem_t* sem, int64_t milis) {
return 0;
/*return tsem_wait(sem);*/
#if 0
int32_t tsem_timewait(tsem_t* sem, int64_t ms) {
struct timespec ts;
timespec_get(&ts);
taosClockGetTime(0, &ts);
ts.tv_nsec += ms * 1000000;
ts.tv_sec += ts.tv_nsec / 1000000000;
ts.tv_nsec %= 1000000000;
/*GetSystemTimeAsFileTime(&ft_before);*/
// errno = 0;
rc = sem_timedwait(sem, ts);
int rc;
while ((rc = sem_timedwait(sem, &ts)) == -1 && errno == EINTR) continue;
return rc;
/* This should have timed out */
// assert(errno == ETIMEDOUT);
// assert(rc != 0);
@ -103,8 +99,6 @@ int32_t tsem_timewait(tsem_t* sem, int64_t milis) {
// printf("time must advance during sem_timedwait.");
// return 1;
// }
return rc;
#endif
}
#elif defined(_TD_DARWIN_64)