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
833ec3d3
Commit
833ec3d3
authored
Feb 03, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/upnp/Discovery: remove locking from ExpireDevices()
parent
3d446d32
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
Discovery.cxx
src/lib/upnp/Discovery.cxx
+4
-7
Discovery.hxx
src/lib/upnp/Discovery.hxx
+2
-0
No files found.
src/lib/upnp/Discovery.cxx
View file @
833ec3d3
...
...
@@ -212,7 +212,6 @@ UPnPDeviceDirectory::Invoke(Upnp_EventType et, void *evp)
bool
UPnPDeviceDirectory
::
ExpireDevices
(
Error
&
error
)
{
const
ScopeLock
protect
(
mutex
);
const
unsigned
now
=
MonotonicClockS
();
bool
didsomething
=
false
;
...
...
@@ -291,12 +290,11 @@ bool
UPnPDeviceDirectory
::
GetDirectories
(
std
::
vector
<
ContentDirectoryService
>
&
out
,
Error
&
error
)
{
// Has locking, do it before our own lock
const
ScopeLock
protect
(
mutex
);
if
(
!
ExpireDevices
(
error
))
return
false
;
const
ScopeLock
protect
(
mutex
);
for
(
auto
dit
=
directories
.
begin
();
dit
!=
directories
.
end
();
dit
++
)
{
for
(
const
auto
&
service
:
dit
->
device
.
services
)
{
...
...
@@ -314,12 +312,11 @@ UPnPDeviceDirectory::GetServer(const char *friendly_name,
ContentDirectoryService
&
server
,
Error
&
error
)
{
// Has locking, do it before our own lock
const
ScopeLock
protect
(
mutex
);
if
(
!
ExpireDevices
(
error
))
return
false
;
const
ScopeLock
protect
(
mutex
);
for
(
const
auto
&
i
:
directories
)
{
const
auto
&
device
=
i
.
device
;
...
...
src/lib/upnp/Discovery.hxx
View file @
833ec3d3
...
...
@@ -138,6 +138,8 @@ private:
* Look at the devices and get rid of those which have not
* been seen for too long. We do this when listing the top
* directory.
*
* Caller must lock #mutex.
*/
bool
ExpireDevices
(
Error
&
error
);
...
...
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