Skip to content

Commit 3a35f70

Browse files
author
Shuo Chen
committed
Fix for 32-bit
1 parent 393a3db commit 3a35f70

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

backport.diff

100755100644
File mode changed.

muduo/base/Thread.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ bool CurrentThread::isMainThread()
146146
void CurrentThread::sleepUsec(int64_t usec)
147147
{
148148
struct timespec ts = { 0, 0 };
149-
ts.tv_sec = usec / Timestamp::kMicroSecondsPerSecond;
150-
ts.tv_nsec = usec % Timestamp::kMicroSecondsPerSecond * 1000;
149+
ts.tv_sec = static_cast<time_t>(usec / Timestamp::kMicroSecondsPerSecond);
150+
ts.tv_nsec = static_cast<long>(usec % Timestamp::kMicroSecondsPerSecond * 1000);
151151
::nanosleep(&ts, NULL);
152152
}
153153

0 commit comments

Comments
 (0)