提交 51b72319 编写于 作者: dengyihao's avatar dengyihao

add timeout to auth

上级 5362a173
...@@ -89,34 +89,35 @@ int32_t taosGetCurrentAPPName(char* name, int32_t* len) { ...@@ -89,34 +89,35 @@ int32_t taosGetCurrentAPPName(char* name, int32_t* len) {
#endif #endif
// #if (defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)) #if (defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32))
// int32_t tsem_timewait(tsem_t* sem, int64_t ms) { int32_t tsem_timewait(tsem_t* sem, int64_t ms) {
// struct timespec ts; return tsem_wait(sem);
// taosClockGetTime(0, &ts); // struct timespec ts;
// taosClockGetTime(0, &ts);
// ts.tv_nsec += ms * 1000000;
// ts.tv_sec += ts.tv_nsec / 1000000000; // ts.tv_nsec += ms * 1000000;
// ts.tv_nsec %= 1000000000; // ts.tv_sec += ts.tv_nsec / 1000000000;
// int rc; // ts.tv_nsec %= 1000000000;
// while ((rc = sem_timedwait(sem, &ts)) == -1 && errno == EINTR) continue; // int rc;
// return rc; // while ((rc = sem_timedwait(sem, &ts)) == -1 && errno == EINTR) continue;
// /* This should have timed out */ // return rc;
// // ASSERT(errno == ETIMEDOUT); // /* This should have timed out */
// // ASSERT(rc != 0); // // ASSERT(errno == ETIMEDOUT);
// // GetSystemTimeAsFileTime(&ft_after); // // ASSERT(rc != 0);
// // // We specified a non-zero wait. Time must advance. // // GetSystemTimeAsFileTime(&ft_after);
// // if (ft_before.dwLowDateTime == ft_after.dwLowDateTime && ft_before.dwHighDateTime == ft_after.dwHighDateTime) // // // We specified a non-zero wait. Time must advance.
// // { // // if (ft_before.dwLowDateTime == ft_after.dwLowDateTime && ft_before.dwHighDateTime == ft_after.dwHighDateTime)
// // printf("nanoseconds: %d, rc: %d, code:0x%x. before filetime: %d, %d; after filetime: %d, %d\n", // // {
// // nanosecs, rc, errno, // // printf("nanoseconds: %d, rc: %d, code:0x%x. before filetime: %d, %d; after filetime: %d, %d\n",
// // (int)ft_before.dwLowDateTime, (int)ft_before.dwHighDateTime, // // nanosecs, rc, errno,
// // (int)ft_after.dwLowDateTime, (int)ft_after.dwHighDateTime); // // (int)ft_before.dwLowDateTime, (int)ft_before.dwHighDateTime,
// // printf("time must advance during sem_timedwait."); // // (int)ft_after.dwLowDateTime, (int)ft_after.dwHighDateTime);
// // return 1; // // printf("time must advance during sem_timedwait.");
// // } // // return 1;
// } // // }
}
// #endif #endif
// #if defined(_TD_DARWIN_64) // #if defined(_TD_DARWIN_64)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册