We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 393a3db commit 3a35f70Copy full SHA for 3a35f70
backport.diff
100755
100644
muduo/base/Thread.cc
@@ -146,8 +146,8 @@ bool CurrentThread::isMainThread()
146
void CurrentThread::sleepUsec(int64_t usec)
147
{
148
struct timespec ts = { 0, 0 };
149
- ts.tv_sec = usec / Timestamp::kMicroSecondsPerSecond;
150
- ts.tv_nsec = usec % Timestamp::kMicroSecondsPerSecond * 1000;
+ ts.tv_sec = static_cast<time_t>(usec / Timestamp::kMicroSecondsPerSecond);
+ ts.tv_nsec = static_cast<long>(usec % Timestamp::kMicroSecondsPerSecond * 1000);
151
::nanosleep(&ts, NULL);
152
}
153
0 commit comments