Merge pull request #18613 from taosdata/FIX/xsren/TD-20738-timewait
fix:window time wait
This commit is contained in:
commit
8efb45ffbf
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue