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
a4202165
Commit
a4202165
authored
Dec 29, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
thread/Cond: make the integer-based timed_wait() overload private
Make sure this deprecated API is not used.
parent
2498a2b0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
PosixCond.hxx
src/thread/PosixCond.hxx
+2
-0
WindowsCond.hxx
src/thread/WindowsCond.hxx
+2
-0
No files found.
src/thread/PosixCond.hxx
View file @
a4202165
...
...
@@ -74,6 +74,7 @@ public:
pthread_cond_wait
(
&
cond
,
&
mutex
.
mutex
);
}
private
:
bool
timed_wait
(
PosixMutex
&
mutex
,
unsigned
timeout_ms
)
{
struct
timeval
now
;
gettimeofday
(
&
now
,
nullptr
);
...
...
@@ -90,6 +91,7 @@ public:
return
pthread_cond_timedwait
(
&
cond
,
&
mutex
.
mutex
,
&
ts
)
==
0
;
}
public
:
bool
timed_wait
(
PosixMutex
&
mutex
,
std
::
chrono
::
steady_clock
::
duration
timeout
)
{
auto
timeout_ms
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
timeout
).
count
();
...
...
src/thread/WindowsCond.hxx
View file @
a4202165
...
...
@@ -56,11 +56,13 @@ public:
WakeAllConditionVariable
(
&
cond
);
}
private
:
bool
timed_wait
(
CriticalSection
&
mutex
,
DWORD
timeout_ms
)
{
return
SleepConditionVariableCS
(
&
cond
,
&
mutex
.
critical_section
,
timeout_ms
);
}
public
:
bool
timed_wait
(
CriticalSection
&
mutex
,
std
::
chrono
::
steady_clock
::
duration
timeout
)
{
auto
timeout_ms
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
timeout
).
count
();
...
...
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