We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clock_gettime(CLOCK_REALTIME, &ts); uint64_t ns = ts.tv_sec * 1000 * 1000 * 1000 + ts.tv_nsec; ns += ms * 1000 * 1000; ts.tv_sec = ns / (1000 * 1000 * 1000); ts.tv_nsec = ns % 1000 * 1000 * 1000; ret = sem_timedwait(lock, &ts);
uint64_t ns = ts.tv_sec * 1000 * 1000 * 1000 + ts.tv_nsec; 运行平台为arm32,计算ns 时会使用uint32类型,导致运算出现溢出, ts.tv_sec前增加强制转换为 uint64_t 可以解决
The text was updated successfully, but these errors were encountered:
No branches or pull requests
clock_gettime(CLOCK_REALTIME, &ts);
uint64_t ns = ts.tv_sec * 1000 * 1000 * 1000 + ts.tv_nsec;
ns += ms * 1000 * 1000;
ts.tv_sec = ns / (1000 * 1000 * 1000);
ts.tv_nsec = ns % 1000 * 1000 * 1000;
ret = sem_timedwait(lock, &ts);
uint64_t ns = ts.tv_sec * 1000 * 1000 * 1000 + ts.tv_nsec;
运行平台为arm32,计算ns 时会使用uint32类型,导致运算出现溢出, ts.tv_sec前增加强制转换为 uint64_t 可以解决
The text was updated successfully, but these errors were encountered: