Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
72c84ba4
Commit
72c84ba4
authored
Feb 08, 2016
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "upnp: fix deadlock when calling UpnpFinish locked"
This reverts commit
7e11257c
.
parent
e1588d2c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
16 deletions
+1
-16
modules/services_discovery/upnp.cpp
modules/services_discovery/upnp.cpp
+1
-15
modules/services_discovery/upnp.hpp
modules/services_discovery/upnp.hpp
+0
-1
No files found.
modules/services_discovery/upnp.cpp
View file @
72c84ba4
...
@@ -74,7 +74,6 @@ struct access_sys_t
...
@@ -74,7 +74,6 @@ struct access_sys_t
UpnpInstanceWrapper
*
UpnpInstanceWrapper
::
s_instance
;
UpnpInstanceWrapper
*
UpnpInstanceWrapper
::
s_instance
;
vlc_mutex_t
UpnpInstanceWrapper
::
s_lock
=
VLC_STATIC_MUTEX
;
vlc_mutex_t
UpnpInstanceWrapper
::
s_lock
=
VLC_STATIC_MUTEX
;
vlc_cond_t
UpnpInstanceWrapper
::
s_cond
=
VLC_STATIC_COND
;
/*
/*
* VLC callback prototypes
* VLC callback prototypes
...
@@ -1079,12 +1078,6 @@ UpnpInstanceWrapper::~UpnpInstanceWrapper()
...
@@ -1079,12 +1078,6 @@ UpnpInstanceWrapper::~UpnpInstanceWrapper()
UpnpInstanceWrapper
*
UpnpInstanceWrapper
::
get
(
vlc_object_t
*
p_obj
,
Upnp_FunPtr
callback
,
SD
::
MediaServerList
*
opaque
)
UpnpInstanceWrapper
*
UpnpInstanceWrapper
::
get
(
vlc_object_t
*
p_obj
,
Upnp_FunPtr
callback
,
SD
::
MediaServerList
*
opaque
)
{
{
vlc_mutex_locker
lock
(
&
s_lock
);
vlc_mutex_locker
lock
(
&
s_lock
);
/* refcount is 0 but instance is not NULL, UpnpFinish is being called so
* wait for it to finish */
while
(
s_instance
!=
NULL
&&
s_instance
->
refcount_
==
0
)
vlc_cond_wait
(
&
s_cond
,
&
s_lock
);
if
(
s_instance
==
NULL
)
if
(
s_instance
==
NULL
)
{
{
UpnpInstanceWrapper
*
instance
=
new
(
std
::
nothrow
)
UpnpInstanceWrapper
;
UpnpInstanceWrapper
*
instance
=
new
(
std
::
nothrow
)
UpnpInstanceWrapper
;
...
@@ -1143,7 +1136,7 @@ UpnpInstanceWrapper *UpnpInstanceWrapper::get(vlc_object_t *p_obj, Upnp_FunPtr c
...
@@ -1143,7 +1136,7 @@ UpnpInstanceWrapper *UpnpInstanceWrapper::get(vlc_object_t *p_obj, Upnp_FunPtr c
void
UpnpInstanceWrapper
::
release
(
bool
isSd
)
void
UpnpInstanceWrapper
::
release
(
bool
isSd
)
{
{
vlc_mutex_lock
(
&
s_lock
);
vlc_mutex_lock
er
lock
(
&
s_lock
);
if
(
isSd
)
if
(
isSd
)
{
{
callback_
=
NULL
;
callback_
=
NULL
;
...
@@ -1151,16 +1144,9 @@ void UpnpInstanceWrapper::release(bool isSd)
...
@@ -1151,16 +1144,9 @@ void UpnpInstanceWrapper::release(bool isSd)
}
}
if
(
--
s_instance
->
refcount_
==
0
)
if
(
--
s_instance
->
refcount_
==
0
)
{
{
vlc_mutex_unlock
(
&
s_lock
);
/* UpnpFinish must be called unlocked since callbacks can still be
* called when shuting down upnp threads */
delete
s_instance
;
delete
s_instance
;
vlc_mutex_lock
(
&
s_lock
);
s_instance
=
NULL
;
s_instance
=
NULL
;
vlc_cond_signal
(
&
s_cond
);
}
}
vlc_mutex_unlock
(
&
s_lock
);
}
}
UpnpClient_Handle
UpnpInstanceWrapper
::
handle
()
const
UpnpClient_Handle
UpnpInstanceWrapper
::
handle
()
const
...
...
modules/services_discovery/upnp.hpp
View file @
72c84ba4
...
@@ -71,7 +71,6 @@ private:
...
@@ -71,7 +71,6 @@ private:
private:
private:
static
UpnpInstanceWrapper
*
s_instance
;
static
UpnpInstanceWrapper
*
s_instance
;
static
vlc_mutex_t
s_lock
;
static
vlc_mutex_t
s_lock
;
static
vlc_cond_t
s_cond
;
UpnpClient_Handle
handle_
;
UpnpClient_Handle
handle_
;
SD
::
MediaServerList
*
opaque_
;
SD
::
MediaServerList
*
opaque_
;
Upnp_FunPtr
callback_
;
Upnp_FunPtr
callback_
;
...
...
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