[IE][VPU]: Fixed the calculation of timeout for x32 system (#3842)
This commit is contained in:
parent
e9a52d39ac
commit
5d63b5f41f
@ -61,7 +61,7 @@ class PThreadBinSemaphoreTest : public ::testing::TestWithParam<int>{
|
||||
std::cerr << "clock_gettime";
|
||||
}
|
||||
|
||||
auto newNsec = (long)(spec.tv_nsec + timeout * 1000000000L);
|
||||
auto newNsec = static_cast<long long>(spec.tv_nsec + timeout * 1000000000LL);
|
||||
spec.tv_sec += newNsec / 1000000000L;
|
||||
spec.tv_nsec = newNsec % 1000000000L;
|
||||
|
||||
|
@ -239,8 +239,9 @@ void WatchdogImpl::waitFor(const milliseconds sleepInterval) {
|
||||
#else
|
||||
clock_gettime(CLOCK_MONOTONIC, &timeToWait);
|
||||
const auto secondInNanoSeconds = 1000000000L;
|
||||
const auto nsecSum = std::chrono::duration_cast<std::chrono::nanoseconds>(sleepInterval).count() -
|
||||
std::chrono::nanoseconds(sec).count() + timeToWait.tv_nsec;
|
||||
const auto nsecSum = static_cast<long long>(
|
||||
std::chrono::duration_cast<std::chrono::nanoseconds>(sleepInterval).count() -
|
||||
std::chrono::nanoseconds(sec).count() + timeToWait.tv_nsec);
|
||||
timeToWait.tv_sec += sec.count() + nsecSum / secondInNanoSeconds;
|
||||
timeToWait.tv_nsec = nsecSum % secondInNanoSeconds;
|
||||
#endif // (defined(__APPLE__) || defined(_WIN32))
|
||||
|
Loading…
Reference in New Issue
Block a user