Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
86682176
Unverified
Commit
86682176
authored
Jul 16, 2018
by
Yue Wang
Committed by
GitHub
Jul 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use uint_least32_t instead of long for timeout
parent
79937c94
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
PosixCond.hxx
src/thread/PosixCond.hxx
+3
-3
No files found.
src/thread/PosixCond.hxx
View file @
86682176
...
...
@@ -75,7 +75,7 @@ public:
}
private
:
bool
timed_wait
(
PosixMutex
&
mutex
,
long
timeout_us
)
noexcept
{
bool
timed_wait
(
PosixMutex
&
mutex
,
uint_least32_t
timeout_us
)
noexcept
{
struct
timeval
now
;
gettimeofday
(
&
now
,
nullptr
);
...
...
@@ -97,8 +97,8 @@ public:
auto
timeout_us
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
microseconds
>
(
timeout
).
count
();
if
(
timeout_us
<
0
)
timeout_us
=
0
;
else
if
(
timeout_us
>
std
::
numeric_limits
<
long
>::
max
())
timeout_us
=
std
::
numeric_limits
<
long
>::
max
();
else
if
(
timeout_us
>
std
::
numeric_limits
<
uint_least32_t
>::
max
())
timeout_us
=
std
::
numeric_limits
<
uint_least32_t
>::
max
();
return
timed_wait
(
mutex
,
timeout_us
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment