fix:window time wait
This commit is contained in:
parent
6bfcc2e4c3
commit
a450fae89a
|
@ -76,19 +76,15 @@ int32_t tsem_wait(tsem_t* sem) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t tsem_timewait(tsem_t* sem, int64_t milis) {
|
int32_t tsem_timewait(tsem_t* sem, int64_t milis) {
|
||||||
return 0;
|
|
||||||
/*return tsem_wait(sem);*/
|
|
||||||
#if 0
|
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
timespec_get(&ts);
|
taosClockGetTime(0, &ts);
|
||||||
|
|
||||||
ts.tv_nsec += ms * 1000000;
|
ts.tv_nsec += ms * 1000000;
|
||||||
ts.tv_sec += ts.tv_nsec / 1000000000;
|
ts.tv_sec += ts.tv_nsec / 1000000000;
|
||||||
ts.tv_nsec %= 1000000000;
|
ts.tv_nsec %= 1000000000;
|
||||||
|
int rc;
|
||||||
/*GetSystemTimeAsFileTime(&ft_before);*/
|
while ((rc = sem_timedwait(sem, &ts)) == -1 && errno == EINTR) continue;
|
||||||
// errno = 0;
|
return rc;
|
||||||
rc = sem_timedwait(sem, ts);
|
|
||||||
|
|
||||||
/* This should have timed out */
|
/* This should have timed out */
|
||||||
// assert(errno == ETIMEDOUT);
|
// assert(errno == ETIMEDOUT);
|
||||||
// assert(rc != 0);
|
// assert(rc != 0);
|
||||||
|
@ -103,8 +99,6 @@ int32_t tsem_timewait(tsem_t* sem, int64_t milis) {
|
||||||
// printf("time must advance during sem_timedwait.");
|
// printf("time must advance during sem_timedwait.");
|
||||||
// return 1;
|
// return 1;
|
||||||
// }
|
// }
|
||||||
return rc;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(_TD_DARWIN_64)
|
#elif defined(_TD_DARWIN_64)
|
||||||
|
|
Loading…
Reference in New Issue