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
7ec70792
Commit
7ec70792
authored
Dec 29, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/nfs/Blocking, neighbor/smbclient: pass std::chrono::duration to Cond::timed_wait()
parent
837134da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
Blocking.cxx
src/lib/nfs/Blocking.cxx
+2
-0
Blocking.hxx
src/lib/nfs/Blocking.hxx
+3
-2
SmbclientNeighborPlugin.cxx
src/neighbor/plugins/SmbclientNeighborPlugin.cxx
+1
-1
No files found.
src/lib/nfs/Blocking.cxx
View file @
7ec70792
...
...
@@ -22,6 +22,8 @@
#include "Connection.hxx"
#include "event/Call.hxx"
constexpr
std
::
chrono
::
steady_clock
::
duration
BlockingNfsOperation
::
timeout
;
void
BlockingNfsOperation
::
Run
()
{
...
...
src/lib/nfs/Blocking.hxx
View file @
7ec70792
...
...
@@ -36,7 +36,8 @@ class NfsConnection;
* thread, and method Run() waits for completion.
*/
class
BlockingNfsOperation
:
protected
NfsCallback
,
NfsLease
{
static
constexpr
unsigned
timeout_ms
=
60000
;
static
constexpr
std
::
chrono
::
steady_clock
::
duration
timeout
=
std
::
chrono
::
minutes
(
1
);
Mutex
mutex
;
Cond
cond
;
...
...
@@ -61,7 +62,7 @@ private:
bool
LockWaitFinished
()
{
const
ScopeLock
protect
(
mutex
);
while
(
!
finished
)
if
(
!
cond
.
timed_wait
(
mutex
,
timeout
_ms
))
if
(
!
cond
.
timed_wait
(
mutex
,
timeout
))
return
false
;
return
true
;
...
...
src/neighbor/plugins/SmbclientNeighborPlugin.cxx
View file @
7ec70792
...
...
@@ -251,7 +251,7 @@ SmbclientNeighborExplorer::ThreadFunc()
break
;
// TODO: sleep for how long?
cond
.
timed_wait
(
mutex
,
10000
);
cond
.
timed_wait
(
mutex
,
std
::
chrono
::
seconds
(
10
)
);
}
mutex
.
unlock
();
...
...
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